Sunday, May 11, 2025
1 change · 17.0
Miscellaneous changes
### Problem: When applying a discount on a POS order line using a pricelist, if the unit price has more than two decimal places and the quantity is greater than one, the order line may be incorrectly flagged as manually set due to a rounding mismatch. This logic was introduced by the following commit: https://github.com/odoo/odoo/commit/775c5c95cf763c14715fd0e82e88ff841371d212 The incorrect behavior is caused by computing the product display price by rounding the unit price first, then mu
Original PR description
### Problem: When applying a discount on a POS order line using a pricelist, if the unit price has more than two decimal places and the quantity is greater than one, the order line may be incorrectly…
### Problem:
When applying a discount on a POS order line using a pricelist, if the unit price has more than two decimal places and the quantity is greater than one, the order line may be incorrectly flagged as manually set due to a rounding mismatch.
This logic was introduced by the following commit: https://github.com/odoo/odoo/commit/775c5c95cf763c14715fd0e82e88ff841371d212
The incorrect behavior is caused by computing the product display price by rounding the unit price first, then multiplying by the quantity, rather than rounding the total.
- Example:
* Unit price = 30.47619047619047
* Expected rounded price for 2 quantity: round(unit price * 2) = 60.95
* Current rounded price for 2 quantity: round(unit price) * 2 = 60.96
The issue only occurs on V16 and V17
### How to reproduce:
* Create a tax and check **Included in Price**.
* Add a product with total price (the tax excluded price will be calculated).
* Check flexible pricelist, and add one to the POS config in settings.
* Check product prices settings as Tax-Execluded Price.
* Open a restaurant pos config.
* Add two units of the product.
* Go back to main floor and access the table again.
* Apply the discount (it will not apply).
opw-4731266
Forward-Port-Of: odoo/odoo#208390