-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by carmenbianca
- Loading branch information
Showing
14 changed files
with
684 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
======================= | ||
Portal POS order amount | ||
======================= | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:b974534b073516b491e4a8654a41d349cec7ef822a8683195e2eaa4337796692 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Beta | ||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-beescoop%2FObeesdoo-lightgray.png?logo=github | ||
:target: https://github.com/beescoop/Obeesdoo/tree/16.0/portal_pos_order_amount | ||
:alt: beescoop/Obeesdoo | ||
|
||
|badge1| |badge2| |badge3| | ||
|
||
Show the total amount of pos order in the website portal. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Known issues / Roadmap | ||
====================== | ||
|
||
- Move the table from the side bar to the main content area. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/beescoop/Obeesdoo/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
`feedback <https://github.com/beescoop/Obeesdoo/issues/new?body=module:%20portal_pos_order_amount%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
~~~~~~~ | ||
|
||
* Coop IT Easy SC | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* BEES coop - Cellule IT | ||
* Coop IT Easy SC | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
This module is part of the `beescoop/Obeesdoo <https://github.com/beescoop/Obeesdoo/tree/16.0/portal_pos_order_amount>`_ project on GitHub. | ||
|
||
You are welcome to contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import controllers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2019 Coop IT Easy SC | ||
# Rémy Taymans <remy@coopiteasy.be> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
{ | ||
"name": "Portal POS order amount", | ||
"summary": """ | ||
Show the total amount of pos order in the website portal. | ||
""", | ||
"author": "Coop IT Easy SC", | ||
"license": "AGPL-3", | ||
"version": "16.0.1.0.0", | ||
"website": "https://github.com/beescoop/Obeesdoo", | ||
"category": "Website", | ||
"depends": ["portal", "point_of_sale"], | ||
"data": ["templates/portal_pos_order_amount.xml"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright 2018 Rémy Taymans <remytaymans@gmail.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
|
||
from itertools import groupby | ||
|
||
from odoo.http import request | ||
|
||
from odoo.addons.portal.controllers.portal import CustomerPortal | ||
|
||
|
||
class PortalPosOrderAmount(CustomerPortal): | ||
def _prepare_portal_layout_values(self): | ||
values = super(PortalPosOrderAmount, self)._prepare_portal_layout_values() | ||
user = request.env.user | ||
owned_pos_order = ( | ||
request.env["pos.order"] | ||
.sudo() | ||
.search( | ||
[ | ||
( | ||
"partner_id", | ||
"=", | ||
user.partner_id.commercial_partner_id.id, | ||
), | ||
("state", "!=", "cancel"), | ||
] | ||
) | ||
) | ||
values["pos_order_amount"] = sum(po.amount_total for po in owned_pos_order) | ||
values["pos_order_amount_by_year"] = [ | ||
{ | ||
"year": year, | ||
"amount": sum( | ||
pos_order.amount_total for pos_order in grouped_pos_orders | ||
), | ||
} | ||
for year, grouped_pos_orders in groupby( | ||
owned_pos_order, key=lambda pos_order: pos_order.date_order.year | ||
) | ||
] | ||
values["company_currency"] = request.env.company.currency_id | ||
return values |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * portal_pos_order_amount | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 12.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2023-05-12 09:42+0000\n" | ||
"PO-Revision-Date: 2023-05-12 09:42+0000\n" | ||
"Last-Translator: <>\n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: portal_pos_order_amount | ||
#: model_terms:ir.ui.view,arch_db:portal_pos_order_amount.total_pos_order_amount | ||
msgid "Amount" | ||
msgstr "Montant" | ||
|
||
#. module: portal_pos_order_amount | ||
#: model_terms:ir.ui.view,arch_db:portal_pos_order_amount.total_pos_order_amount | ||
msgid "Purchases" | ||
msgstr "Achats" | ||
|
||
#. module: portal_pos_order_amount | ||
#: model_terms:ir.ui.view,arch_db:portal_pos_order_amount.total_pos_order_amount | ||
msgid "Year" | ||
msgstr "Année" | ||
|
||
#. module: portal_pos_order_amount | ||
#: model_terms:ir.ui.view,arch_db:portal_pos_order_amount.total_pos_order_amount | ||
msgid "You have purchased a total amount of" | ||
msgstr "Vous avez dépensé un total de" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * portal_pos_order_amount | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 12.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"Last-Translator: <>\n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: portal_pos_order_amount | ||
#: model_terms:ir.ui.view,arch_db:portal_pos_order_amount.total_pos_order_amount | ||
msgid "Amount" | ||
msgstr "" | ||
|
||
#. module: portal_pos_order_amount | ||
#: model_terms:ir.ui.view,arch_db:portal_pos_order_amount.total_pos_order_amount | ||
msgid "Purchases" | ||
msgstr "" | ||
|
||
#. module: portal_pos_order_amount | ||
#: model_terms:ir.ui.view,arch_db:portal_pos_order_amount.total_pos_order_amount | ||
msgid "Year" | ||
msgstr "" | ||
|
||
#. module: portal_pos_order_amount | ||
#: model_terms:ir.ui.view,arch_db:portal_pos_order_amount.total_pos_order_amount | ||
msgid "You have purchased a total amount of" | ||
msgstr "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* BEES coop - Cellule IT | ||
* Coop IT Easy SC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Show the total amount of pos order in the website portal. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Move the table from the side bar to the main content area. |
Oops, something went wrong.