From c011c5464a72b0ae4ee0af22250f05d3f5cbbdb1 Mon Sep 17 00:00:00 2001 From: roen-odoo Date: Mon, 20 Dec 2021 10:18:48 +0000 Subject: [PATCH] [FIX] pos_cash_rounding : Unpaid orders when using cash rounding Current behavior : When using cash rouding method "HALF-UP" if the difference between the rounded price and the original price was exactly the half of the cash rounding, the order would appear as unpaid. Steps to reproduce : - Create a rounding method of 0.5 (half-up) - Sell a product for 11.25 - The order appears unpaid in the PoS orders list view opw-2593687 closes odoo/odoo#81830 X-original-commit: 3c452f9f731490ce94331f40ffdbe1957052000e Signed-off-by: Grazioso Andrea (agr) Signed-off-by: Engels Robin (roen) --- addons/point_of_sale/models/pos_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index 2f63db01d9a..3fafb06b35e 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -569,7 +569,7 @@ class PosOrder(models.Model): maxDiff = currency.round(self.config_id.rounding_method.rounding) diff = currency.round(self.amount_total - self.amount_paid) - if not abs(diff) < maxDiff: + if not abs(diff) <= maxDiff: raise UserError(_("Order %s is not fully paid.", self.name)) self.write({'state': 'paid'})