Skip to content

Commit

Permalink
Merge PR #527 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by carmenbianca
  • Loading branch information
github-grap-bot committed Jan 31, 2024
2 parents 2579391 + 3163399 commit cc1caec
Show file tree
Hide file tree
Showing 14 changed files with 684 additions and 0 deletions.
66 changes: 66 additions & 0 deletions portal_pos_order_amount/README.rst
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.
1 change: 1 addition & 0 deletions portal_pos_order_amount/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import controllers
16 changes: 16 additions & 0 deletions portal_pos_order_amount/__manifest__.py
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"],
}
1 change: 1 addition & 0 deletions portal_pos_order_amount/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import main
43 changes: 43 additions & 0 deletions portal_pos_order_amount/controllers/main.py
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
37 changes: 37 additions & 0 deletions portal_pos_order_amount/i18n/fr.po
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"

35 changes: 35 additions & 0 deletions portal_pos_order_amount/i18n/portal_pos_order_amount.pot
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 ""

2 changes: 2 additions & 0 deletions portal_pos_order_amount/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* BEES coop - Cellule IT
* Coop IT Easy SC
1 change: 1 addition & 0 deletions portal_pos_order_amount/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Show the total amount of pos order in the website portal.
1 change: 1 addition & 0 deletions portal_pos_order_amount/readme/ROADMAP.rst
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.
Loading

0 comments on commit cc1caec

Please sign in to comment.