From 7b9e8e5c1c8e72b027fc90d3ce8e69a4e9fa0232 Mon Sep 17 00:00:00 2001 From: "Laurent Desausoi (lade)" Date: Thu, 28 Apr 2022 15:03:39 +0000 Subject: [PATCH] [FIX] point_of_sale: avoid having "discount" on invoices without reason When selecting products with a certain price in POS (e.g.: 24.99, 5.1), the POS displays as if there were a discount while they aren't any (e.g.: ~~$24.99~~ $24.99 instead of just $24.99). Step to reproduce the issue: 1. Install POS and Sales 2. In Sales settings activate "Discounts" and "Pricelists" with advanced price rules 3. In the pricelist activate the discount policy "Show public price & discount to the customer" 4. Create a product with a price of 24.99 without tax (or with tax but in the end the total must be 24.99) 5. In POS select the product. It will show that the price of the product went from 24.99 to 24.99, while we should simply see 24.99. Solution: The issue comes from the backend that sends to the POS (upon loading) some prices with invalid precision (giving, 24.990000000002 or 5.1000000005). Consequently, following the logic of the POS, he think that the `price` and `lst_price` are different because the `price` is rounded after applying any discount (in this case, none). As I was not able to understand why we have such a rounding in the backend, a workaround was to also round everything before checking if there is a discount. opw-2780083 closes odoo/odoo#90345 X-original-commit: 0a8391b4420f038056dfccc7d4391969a1fd97f5 Signed-off-by: Masereel Pierre --- .../static/src/xml/Screens/ProductScreen/Orderline.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/xml/Screens/ProductScreen/Orderline.xml b/addons/point_of_sale/static/src/xml/Screens/ProductScreen/Orderline.xml index 36928459de9..9cfead35289 100644 --- a/addons/point_of_sale/static/src/xml/Screens/ProductScreen/Orderline.xml +++ b/addons/point_of_sale/static/src/xml/Screens/ProductScreen/Orderline.xml @@ -37,7 +37,7 @@ at + env.pos.round_decimals_currency(props.line.get_unit_display_price()) < env.pos.round_decimals_currency(props.line.get_lst_price())">