diff --git a/pos_discount_all/README.rst b/pos_discount_all/README.rst index ee5d380319..5b730bb4f3 100644 --- a/pos_discount_all/README.rst +++ b/pos_discount_all/README.rst @@ -17,31 +17,32 @@ Point of Sale - Display All Discounts :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github - :target: https://github.com/OCA/pos/tree/16.0/pos_discount_all + :target: https://github.com/OCA/pos/tree/17.0/pos_discount_all :alt: OCA/pos .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_discount_all + :target: https://translation.odoo-community.org/projects/pos-17-0/pos-17-0-pos_discount_all :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| This module extends the functionality of point of sale module, to -display on the PoS ticket, the amount of the discount applied for this sale. -Contrary to the logic of Odoo and the OCA +display on the PoS ticket, the amount of the discount applied for this +sale. Contrary to the logic of Odoo and the OCA (https://github.com/OCA/sale-workflow/tree/14.0/sale_discount_display_amount) -the amount of the discount is the difference between the theoretical sale with the default price list and the actual sale amount. -So it take into accounts: +the amount of the discount is the difference between the theoretical +sale with the default price list and the actual sale amount. So it take +into accounts: -- explicit discount set on pos.order.line. (as for odoo ``sale`` module) -- fixed price set on pos.order.line -- discount generated by specific pricelist +- explicit discount set on pos.order.line. (as for odoo ``sale`` + module) +- fixed price set on pos.order.line +- discount generated by specific pricelist -Also the module ignores in the computation of undiscounted amount lines, the -lines with a 'Discount Product'. -(see the configure section.) +Also the module ignores in the computation of undiscounted amount lines, +the lines with a 'Discount Product'. (see the configure section.) **Table of contents** @@ -51,29 +52,33 @@ lines with a 'Discount Product'. Configuration ============= -* Go to "Point of Sale > Products" -* Create or edit your discount products -* Check the box "Is a Discount" +- Go to "Point of Sale > Products" +- Create or edit your discount products +- Check the box "Is a Discount" -.. image:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_discount_all/static/description/product_template_form.png +|image| + +.. |image| image:: https://raw.githubusercontent.com/OCA/pos/17.0/pos_discount_all/static/description/product_template_form.png Usage ===== Open your point of Sale -Make an order. for exemple, -- select the product 'Conference chair (39.40$)' -- select the pricelist -10% -- add a discount of 1$ +Make an order. for exemple, - select the product 'Conference chair +(39.40$)' - select the pricelist -10% - add a discount of 1$ + +The total discount is 1$ + 10% \* 39.40 = 4.94$ -The total discount is 1$ + 10% * 39.40 = 4.94$ +|image_summary| -.. image:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_discount_all/static/description/order_summary.png +Note, the discount displayed on the ticket is updated, to take into +account all the discount. -Note, the discount displayed on the ticket is updated, to take into account all the discount. +|image_receipt| -.. image:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_discount_all/static/description/pos_receipt.png +.. |image_summary| image:: https://raw.githubusercontent.com/OCA/pos/17.0/pos_discount_all/static/description/order_summary.png +.. |image_receipt| image:: https://raw.githubusercontent.com/OCA/pos/17.0/pos_discount_all/static/description/pos_receipt.png Development =========== @@ -82,23 +87,23 @@ Development In the javascript file, we could write -.. code-block:: javascript - - const PosDiscountAllOrder = () => - class extends Order { - } +.. code:: javascript -However, this code doesn't work if ``pos_sale`` module is installed. For that -reason we code the declaration as Odoo does, and add eslint exception. + const PosDiscountAllOrder = () => + class extends Order { + } +However, this code doesn't work if ``pos_sale`` module is installed. For +that reason we code the declaration as Odoo does, and add eslint +exception. -.. code-block:: javascript +.. code:: javascript - // eslint-disable-next-line no-shadow - const PosDiscountAllOrder = (Order) => - // eslint-disable-next-line no-shadow - class PosDiscountAllOrder extends Order { - } + // eslint-disable-next-line no-shadow + const PosDiscountAllOrder = (Order) => + // eslint-disable-next-line no-shadow + class PosDiscountAllOrder extends Order { + } Bug Tracker =========== @@ -106,7 +111,7 @@ Bug Tracker Bugs are tracked on `GitHub 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -114,24 +119,25 @@ Credits ======= Authors -~~~~~~~ +------- * GRAP Contributors -~~~~~~~~~~~~ +------------ -* Sylvain LE GAL (https://twitter.com/legalsylvain) +- Sylvain LE GAL (https://twitter.com/legalsylvain) Other credits -~~~~~~~~~~~~~ +------------- The development of this module has been financially supported by: -* UGESS, Union Nationale des Groupements des épiceries Sociales et Solidaires (https://ugess.org/) +- UGESS, Union Nationale des Groupements des épiceries Sociales et + Solidaires (https://ugess.org/) Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -151,6 +157,6 @@ Current `maintainer `__: |maintainer-legalsylvain| -This module is part of the `OCA/pos `_ project on GitHub. +This module is part of the `OCA/pos `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/pos_discount_all/pyproject.toml b/pos_discount_all/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/pos_discount_all/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/pos_discount_all/readme/CONFIGURE.md b/pos_discount_all/readme/CONFIGURE.md new file mode 100644 index 0000000000..ab1acdb5f7 --- /dev/null +++ b/pos_discount_all/readme/CONFIGURE.md @@ -0,0 +1,5 @@ +- Go to "Point of Sale \> Products" +- Create or edit your discount products +- Check the box "Is a Discount" + +![image](../static/description/product_template_form.png) diff --git a/pos_discount_all/readme/CONFIGURE.rst b/pos_discount_all/readme/CONFIGURE.rst deleted file mode 100644 index db2960b07c..0000000000 --- a/pos_discount_all/readme/CONFIGURE.rst +++ /dev/null @@ -1,5 +0,0 @@ -* Go to "Point of Sale > Products" -* Create or edit your discount products -* Check the box "Is a Discount" - -.. image:: ../static/description/product_template_form.png diff --git a/pos_discount_all/readme/CONTRIBUTORS.md b/pos_discount_all/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..18c1c87e0f --- /dev/null +++ b/pos_discount_all/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Sylvain LE GAL () diff --git a/pos_discount_all/readme/CONTRIBUTORS.rst b/pos_discount_all/readme/CONTRIBUTORS.rst deleted file mode 100644 index ae6f43a86d..0000000000 --- a/pos_discount_all/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1 +0,0 @@ -* Sylvain LE GAL (https://twitter.com/legalsylvain) diff --git a/pos_discount_all/readme/CREDITS.md b/pos_discount_all/readme/CREDITS.md new file mode 100644 index 0000000000..4f833c6217 --- /dev/null +++ b/pos_discount_all/readme/CREDITS.md @@ -0,0 +1,4 @@ +The development of this module has been financially supported by: + +- UGESS, Union Nationale des Groupements des épiceries Sociales et + Solidaires () diff --git a/pos_discount_all/readme/CREDITS.rst b/pos_discount_all/readme/CREDITS.rst deleted file mode 100644 index 4c3758b92a..0000000000 --- a/pos_discount_all/readme/CREDITS.rst +++ /dev/null @@ -1,3 +0,0 @@ -The development of this module has been financially supported by: - -* UGESS, Union Nationale des Groupements des épiceries Sociales et Solidaires (https://ugess.org/) diff --git a/pos_discount_all/readme/DESCRIPTION.md b/pos_discount_all/readme/DESCRIPTION.md new file mode 100644 index 0000000000..1971572f33 --- /dev/null +++ b/pos_discount_all/readme/DESCRIPTION.md @@ -0,0 +1,14 @@ +This module extends the functionality of point of sale module, to +display on the PoS ticket, the amount of the discount applied for this +sale. Contrary to the logic of Odoo and the OCA +() +the amount of the discount is the difference between the theoretical +sale with the default price list and the actual sale amount. So it take +into accounts: + +- explicit discount set on pos.order.line. (as for odoo `sale` module) +- fixed price set on pos.order.line +- discount generated by specific pricelist + +Also the module ignores in the computation of undiscounted amount lines, +the lines with a 'Discount Product'. (see the configure section.) diff --git a/pos_discount_all/readme/DESCRIPTION.rst b/pos_discount_all/readme/DESCRIPTION.rst deleted file mode 100644 index 297f6bc8e3..0000000000 --- a/pos_discount_all/readme/DESCRIPTION.rst +++ /dev/null @@ -1,14 +0,0 @@ -This module extends the functionality of point of sale module, to -display on the PoS ticket, the amount of the discount applied for this sale. -Contrary to the logic of Odoo and the OCA -(https://github.com/OCA/sale-workflow/tree/14.0/sale_discount_display_amount) -the amount of the discount is the difference between the theoretical sale with the default price list and the actual sale amount. -So it take into accounts: - -- explicit discount set on pos.order.line. (as for odoo ``sale`` module) -- fixed price set on pos.order.line -- discount generated by specific pricelist - -Also the module ignores in the computation of undiscounted amount lines, the -lines with a 'Discount Product'. -(see the configure section.) diff --git a/pos_discount_all/readme/DEVELOP.md b/pos_discount_all/readme/DEVELOP.md new file mode 100644 index 0000000000..ec9e8cf556 --- /dev/null +++ b/pos_discount_all/readme/DEVELOP.md @@ -0,0 +1,21 @@ +**Note** + +In the javascript file, we could write + +``` javascript +const PosDiscountAllOrder = () => + class extends Order { + } +``` + +However, this code doesn't work if `pos_sale` module is installed. For +that reason we code the declaration as Odoo does, and add eslint +exception. + +``` javascript +// eslint-disable-next-line no-shadow +const PosDiscountAllOrder = (Order) => + // eslint-disable-next-line no-shadow + class PosDiscountAllOrder extends Order { + } +``` diff --git a/pos_discount_all/readme/DEVELOP.rst b/pos_discount_all/readme/DEVELOP.rst deleted file mode 100644 index 899a6d20fe..0000000000 --- a/pos_discount_all/readme/DEVELOP.rst +++ /dev/null @@ -1,21 +0,0 @@ -**Note** - -In the javascript file, we could write - -.. code-block:: javascript - - const PosDiscountAllOrder = () => - class extends Order { - } - -However, this code doesn't work if ``pos_sale`` module is installed. For that -reason we code the declaration as Odoo does, and add eslint exception. - - -.. code-block:: javascript - - // eslint-disable-next-line no-shadow - const PosDiscountAllOrder = (Order) => - // eslint-disable-next-line no-shadow - class PosDiscountAllOrder extends Order { - } diff --git a/pos_discount_all/readme/USAGE.md b/pos_discount_all/readme/USAGE.md new file mode 100644 index 0000000000..31f80e4f5e --- /dev/null +++ b/pos_discount_all/readme/USAGE.md @@ -0,0 +1,13 @@ +Open your point of Sale + +Make an order. for exemple, - select the product 'Conference chair +(39.40\$)' - select the pricelist -10% - add a discount of 1\$ + +The total discount is 1\$ + 10% \* 39.40 = 4.94\$ + +![image_summary](../static/description/order_summary.png) + +Note, the discount displayed on the ticket is updated, to take into +account all the discount. + +![image_receipt](../static/description/pos_receipt.png) diff --git a/pos_discount_all/readme/USAGE.rst b/pos_discount_all/readme/USAGE.rst deleted file mode 100644 index 7df5890d56..0000000000 --- a/pos_discount_all/readme/USAGE.rst +++ /dev/null @@ -1,14 +0,0 @@ -Open your point of Sale - -Make an order. for exemple, -- select the product 'Conference chair (39.40$)' -- select the pricelist -10% -- add a discount of 1$ - -The total discount is 1$ + 10% * 39.40 = 4.94$ - -.. image:: ../static/description/order_summary.png - -Note, the discount displayed on the ticket is updated, to take into account all the discount. - -.. image:: ../static/description/pos_receipt.png diff --git a/pos_discount_all/static/description/index.html b/pos_discount_all/static/description/index.html index 6ce44de003..4235445714 100644 --- a/pos_discount_all/static/description/index.html +++ b/pos_discount_all/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -369,21 +369,22 @@

Point of Sale - Display All Discounts

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:29e859f159e20beb7c3ca10008b29d3e608f2de14125fc3aae7aee8c965c47a5 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/pos Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/pos Translate me on Weblate Try me on Runboat

This module extends the functionality of point of sale module, to -display on the PoS ticket, the amount of the discount applied for this sale. -Contrary to the logic of Odoo and the OCA +display on the PoS ticket, the amount of the discount applied for this +sale. Contrary to the logic of Odoo and the OCA (https://github.com/OCA/sale-workflow/tree/14.0/sale_discount_display_amount) -the amount of the discount is the difference between the theoretical sale with the default price list and the actual sale amount. -So it take into accounts:

+the amount of the discount is the difference between the theoretical +sale with the default price list and the actual sale amount. So it take +into accounts:

    -
  • explicit discount set on pos.order.line. (as for odoo sale module)
  • +
  • explicit discount set on pos.order.line. (as for odoo sale +module)
  • fixed price set on pos.order.line
  • discount generated by specific pricelist
-

Also the module ignores in the computation of undiscounted amount lines, the -lines with a ‘Discount Product’. -(see the configure section.)

+

Also the module ignores in the computation of undiscounted amount lines, +the lines with a ‘Discount Product’. (see the configure section.)

Table of contents

    @@ -407,19 +408,18 @@

    Configuration

  • Create or edit your discount products
  • Check the box “Is a Discount”
-https://raw.githubusercontent.com/OCA/pos/16.0/pos_discount_all/static/description/product_template_form.png +

image

Usage

Open your point of Sale

-

Make an order. for exemple, -- select the product ‘Conference chair (39.40$)’ -- select the pricelist -10% -- add a discount of 1$

+

Make an order. for exemple, - select the product ‘Conference chair +(39.40$)’ - select the pricelist -10% - add a discount of 1$

The total discount is 1$ + 10% * 39.40 = 4.94$

-https://raw.githubusercontent.com/OCA/pos/16.0/pos_discount_all/static/description/order_summary.png -

Note, the discount displayed on the ticket is updated, to take into account all the discount.

-https://raw.githubusercontent.com/OCA/pos/16.0/pos_discount_all/static/description/pos_receipt.png +

image_summary

+

Note, the discount displayed on the ticket is updated, to take into +account all the discount.

+

image_receipt

Development

@@ -430,8 +430,9 @@

Development

class extends Order { } -

However, this code doesn’t work if pos_sale module is installed. For that -reason we code the declaration as Odoo does, and add eslint exception.

+

However, this code doesn’t work if pos_sale module is installed. For +that reason we code the declaration as Odoo does, and add eslint +exception.

 // eslint-disable-next-line no-shadow
 const PosDiscountAllOrder = (Order) =>
@@ -445,7 +446,7 @@ 

Bug Tracker

Bugs are tracked on GitHub 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.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -466,19 +467,22 @@

Contributors

Other credits

The development of this module has been financially supported by:

    -
  • UGESS, Union Nationale des Groupements des épiceries Sociales et Solidaires (https://ugess.org/)
  • +
  • UGESS, Union Nationale des Groupements des épiceries Sociales et +Solidaires (https://ugess.org/)

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainer:

legalsylvain

-

This module is part of the OCA/pos project on GitHub.

+

This module is part of the OCA/pos project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/pos_discount_all/tests/test_module.py b/pos_discount_all/tests/test_module.py index 1b18c35969..e05a4bb7ab 100644 --- a/pos_discount_all/tests/test_module.py +++ b/pos_discount_all/tests/test_module.py @@ -11,7 +11,6 @@ @tagged("post_install", "-at_install") class TestUi(TestPointOfSaleHttpCommon): def test_pos_discount_all(self): - pricelist = self.env["product.pricelist"].create( { "name": "Pricelist -10%",