Skip to content

Commit

Permalink
[MIG] pos_discount_all: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Luis-Mora committed Apr 30, 2024
1 parent ebd0752 commit b66fc70
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 30 deletions.
11 changes: 7 additions & 4 deletions pos_discount_all/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ Make an order. for exemple, - select the product 'Conference chair

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

|image|
|image2|

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

|image1|
|image3|

.. |image| image:: https://raw.githubusercontent.com/OCA/pos/17.0/pos_discount_all/static/description/order_summary.png
.. |image1| image:: https://raw.githubusercontent.com/OCA/pos/17.0/pos_discount_all/static/description/pos_receipt.png
.. |image2| image:: https://raw.githubusercontent.com/OCA/pos/17.0/pos_discount_all/static/description/order_summary.png
.. |image3| image:: https://raw.githubusercontent.com/OCA/pos/17.0/pos_discount_all/static/description/pos_receipt.png

Development
===========
Expand Down Expand Up @@ -127,6 +127,9 @@ Contributors
------------

- Sylvain LE GAL (https://twitter.com/legalsylvain)
- `Binhex <https://binhex.cloud//com>`__:

- David Luis Mora <d.luis@binhex.cloud>

Other credits
-------------
Expand Down
2 changes: 1 addition & 1 deletion pos_discount_all/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"name": "Point of Sale - Display All Discounts",
"summary": "Display discount amount on PoS cashier screen and print it on ticket"
"calculated from the difference between a sale with default pricelist",
"version": "16.0.1.0.1",
"version": "17.0.1.0.1",
"category": "Point of Sale",
"maintainers": ["legalsylvain"],
"author": "GRAP,Odoo Community Association (OCA)",
Expand Down
2 changes: 2 additions & 0 deletions pos_discount_all/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
- Sylvain LE GAL (<https://twitter.com/legalsylvain>)
- [Binhex](https://binhex.cloud//com):
- David Luis Mora \<<d.luis@binhex.cloud>\>
4 changes: 2 additions & 2 deletions pos_discount_all/readme/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Make an order. for exemple, - select the product 'Conference chair

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

![image](../static/description/order_summary.png)
![image2](../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)
![image3](../static/description/pos_receipt.png)
50 changes: 28 additions & 22 deletions pos_discount_all/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,21 +369,22 @@ <h1 class="title">Point of Sale - Display All Discounts</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:29e859f159e20beb7c3ca10008b29d3e608f2de14125fc3aae7aee8c965c47a5
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/pos/tree/16.0/pos_discount_all"><img alt="OCA/pos" src="https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_discount_all"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/pos&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/pos/tree/17.0/pos_discount_all"><img alt="OCA/pos" src="https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/pos-17-0/pos-17-0-pos_discount_all"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/pos&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>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
(<a class="reference external" href="https://github.com/OCA/sale-workflow/tree/14.0/sale_discount_display_amount">https://github.com/OCA/sale-workflow/tree/14.0/sale_discount_display_amount</a>)
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:</p>
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:</p>
<ul class="simple">
<li>explicit discount set on pos.order.line. (as for odoo <tt class="docutils literal">sale</tt> module)</li>
<li>explicit discount set on pos.order.line. (as for odoo <tt class="docutils literal">sale</tt>
module)</li>
<li>fixed price set on pos.order.line</li>
<li>discount generated by specific pricelist</li>
</ul>
<p>Also the module ignores in the computation of undiscounted amount lines, the
lines with a ‘Discount Product’.
(see the configure section.)</p>
<p>Also the module ignores in the computation of undiscounted amount lines,
the lines with a ‘Discount Product’. (see the configure section.)</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand All @@ -407,19 +408,18 @@ <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<li>Create or edit your discount products</li>
<li>Check the box “Is a Discount”</li>
</ul>
<img alt="https://raw.githubusercontent.com/OCA/pos/16.0/pos_discount_all/static/description/product_template_form.png" src="https://raw.githubusercontent.com/OCA/pos/16.0/pos_discount_all/static/description/product_template_form.png" />
<p><img alt="image" src="https://raw.githubusercontent.com/OCA/pos/17.0/pos_discount_all/static/description/product_template_form.png" /></p>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
<p>Open your point of Sale</p>
<p>Make an order. for exemple,
- select the product ‘Conference chair (39.40$)’
- select the pricelist -10%
- add a discount of 1$</p>
<p>Make an order. for exemple, - select the product ‘Conference chair
(39.40$)’ - select the pricelist -10% - add a discount of 1$</p>
<p>The total discount is 1$ + 10% * 39.40 = 4.94$</p>
<img alt="https://raw.githubusercontent.com/OCA/pos/16.0/pos_discount_all/static/description/order_summary.png" src="https://raw.githubusercontent.com/OCA/pos/16.0/pos_discount_all/static/description/order_summary.png" />
<p>Note, the discount displayed on the ticket is updated, to take into account all the discount.</p>
<img alt="https://raw.githubusercontent.com/OCA/pos/16.0/pos_discount_all/static/description/pos_receipt.png" src="https://raw.githubusercontent.com/OCA/pos/16.0/pos_discount_all/static/description/pos_receipt.png" />
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/pos/17.0/pos_discount_all/static/description/order_summary.png" /></p>
<p>Note, the discount displayed on the ticket is updated, to take into
account all the discount.</p>
<p><img alt="image3" src="https://raw.githubusercontent.com/OCA/pos/17.0/pos_discount_all/static/description/pos_receipt.png" /></p>
</div>
<div class="section" id="development">
<h1><a class="toc-backref" href="#toc-entry-3">Development</a></h1>
Expand All @@ -430,8 +430,9 @@ <h1><a class="toc-backref" href="#toc-entry-3">Development</a></h1>
</span><span class="kd">class</span><span class="w"> </span><span class="k">extends</span><span class="w"> </span><span class="nx">Order</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="p">}</span>
</pre>
<p>However, this code doesn’t work if <tt class="docutils literal">pos_sale</tt> module is installed. For that
reason we code the declaration as Odoo does, and add eslint exception.</p>
<p>However, this code doesn’t work if <tt class="docutils literal">pos_sale</tt> module is installed. For
that reason we code the declaration as Odoo does, and add eslint
exception.</p>
<pre class="code javascript literal-block">
<span class="c1">// eslint-disable-next-line no-shadow</span><span class="w">
</span><span class="kd">const</span><span class="w"> </span><span class="nx">PosDiscountAllOrder</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="nx">Order</span><span class="p">)</span><span class="w"> </span><span class="p">=&gt;</span><span class="w">
Expand All @@ -445,7 +446,7 @@ <h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/pos/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/pos/issues/new?body=module:%20pos_discount_all%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/pos/issues/new?body=module:%20pos_discount_all%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -460,13 +461,18 @@ <h2><a class="toc-backref" href="#toc-entry-6">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<ul class="simple">
<li>Sylvain LE GAL (<a class="reference external" href="https://twitter.com/legalsylvain">https://twitter.com/legalsylvain</a>)</li>
<li><a class="reference external" href="https://binhex.cloud//com">Binhex</a>:<ul>
<li>David Luis Mora &lt;<a class="reference external" href="mailto:d.luis&#64;binhex.cloud">d.luis&#64;binhex.cloud</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="other-credits">
<h2><a class="toc-backref" href="#toc-entry-8">Other credits</a></h2>
<p>The development of this module has been financially supported by:</p>
<ul class="simple">
<li>UGESS, Union Nationale des Groupements des épiceries Sociales et Solidaires (<a class="reference external" href="https://ugess.org/">https://ugess.org/</a>)</li>
<li>UGESS, Union Nationale des Groupements des épiceries Sociales et
Solidaires (<a class="reference external" href="https://ugess.org/">https://ugess.org/</a>)</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand All @@ -478,7 +484,7 @@ <h2><a class="toc-backref" href="#toc-entry-9">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/legalsylvain"><img alt="legalsylvain" src="https://github.com/legalsylvain.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/pos/tree/16.0/pos_discount_all">OCA/pos</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/pos/tree/17.0/pos_discount_all">OCA/pos</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion pos_discount_all/static/src/xml/OrderSummary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
t-name="OrderSummary"
t-inherit="point_of_sale.OrderSummary"
t-inherit-mode="extension"
owl="1"
>
<xpath expr="//div[@t-if='_tax.hasTax']" position="after">
<t
Expand Down

0 comments on commit b66fc70

Please sign in to comment.