[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) <agr@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
This commit is contained in:
roen-odoo
2021-12-22 20:55:11 +00:00
parent 13842ca9ae
commit c011c5464a
+1 -1
View File
@@ -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'})