Skip to content

Commit 0674b28

Browse files
authored
Merge pull request #1607 from OCA/15.0
Syncing from upstream OCA/product-attribute (15.0)
2 parents 2a854fe + 3d4a18e commit 0674b28

5 files changed

Lines changed: 15 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ addon | version | maintainers | summary
5454
[product_pricelist_direct_print](product_pricelist_direct_print/) | 15.0.1.5.1 | | Print price list from menu option, product templates, products variants or price lists
5555
[product_pricelist_direct_print_company_group](product_pricelist_direct_print_company_group/) | 15.0.1.0.0 | | Print Pricelist items using the company group model
5656
[product_pricelist_direct_print_website_sale](product_pricelist_direct_print_website_sale/) | 15.0.1.0.0 | <a href='https://github.com/CarlosRoca13'><img src='https://github.com/CarlosRoca13.png' width='32' height='32' style='border-radius:50%;' alt='CarlosRoca13'/></a> | Extend Product Pricelist Direct Print for filter by public categories
57-
[product_pricelist_discount_by_range](product_pricelist_discount_by_range/) | 15.0.1.1.0 | | Allows to create priceslists with discount ranges
57+
[product_pricelist_discount_by_range](product_pricelist_discount_by_range/) | 15.0.1.1.1 | | Allows to create priceslists with discount ranges
5858
[product_pricelist_item_list_view](product_pricelist_item_list_view/) | 15.0.1.0.0 | <a href='https://github.com/LoisRForgeFlow'><img src='https://github.com/LoisRForgeFlow.png' width='32' height='32' style='border-radius:50%;' alt='LoisRForgeFlow'/></a> | View and search the list of pricelist items
5959
[product_pricelist_revision](product_pricelist_revision/) | 15.0.1.0.1 | | Product Pricelist Revision
6060
[product_pricelist_simulation](product_pricelist_simulation/) | 15.0.1.0.0 | <a href='https://github.com/legalsylvain'><img src='https://github.com/legalsylvain.png' width='32' height='32' style='border-radius:50%;' alt='legalsylvain'/></a> | Simulate the product price for all pricelists

product_pricelist_discount_by_range/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Product Pricelist Discount by Range
1111
!! This file is generated by oca-gen-addon-readme !!
1212
!! changes will be overwritten. !!
1313
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14-
!! source digest: sha256:9e7fe5384cf08e8dd09ada81a743fdbc0d1160508fd689b4711c97139a1e5c8c
14+
!! source digest: sha256:743f1ef1f09399efba6044b4e9cd41603c10b74e6c3dc69adb33bf1ee2ed7422
1515
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1616
1717
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png

product_pricelist_discount_by_range/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "Product Pricelist Discount by Range",
55
"summary": "Allows to create priceslists with discount ranges",
6-
"version": "15.0.1.1.0",
6+
"version": "15.0.1.1.1",
77
"category": "Sales",
88
"website": "https://github.com/OCA/product-attribute",
99
"author": "Tecnativa, Odoo Community Association (OCA)",

product_pricelist_discount_by_range/models/product_pricelist_item.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,18 @@ def _compute_price_discount(self):
3030
def _compute_price(self, price, price_uom, product, quantity=1.0, partner=False):
3131
if self.discount_type == "range":
3232
discount = None
33+
rounding = self.currency_id.rounding
3334
for discount_range in self.discount_range_ids:
34-
if discount_range.min <= price <= discount_range.max:
35+
if (
36+
tools.float_compare(
37+
price, discount_range.min, precision_rounding=rounding
38+
)
39+
>= 0
40+
and tools.float_compare(
41+
price, discount_range.max, precision_rounding=rounding
42+
)
43+
<= 0
44+
):
3545
discount = discount_range.percentage
3646
break
3747
if discount is not None:

product_pricelist_discount_by_range/static/description/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ <h1>Product Pricelist Discount by Range</h1>
372372
!! This file is generated by oca-gen-addon-readme !!
373373
!! changes will be overwritten. !!
374374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375-
!! source digest: sha256:9e7fe5384cf08e8dd09ada81a743fdbc0d1160508fd689b4711c97139a1e5c8c
375+
!! source digest: sha256:743f1ef1f09399efba6044b4e9cd41603c10b74e6c3dc69adb33bf1ee2ed7422
376376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377377
<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/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/product-attribute/tree/15.0/product_pricelist_discount_by_range"><img alt="OCA/product-attribute" src="https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/product-attribute-15-0/product-attribute-15-0-product_pricelist_discount_by_range"><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/product-attribute&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378378
<p>This module allows you to define discount ranges in a pricelist based

0 commit comments

Comments
 (0)