Enforce strictly positive rounding value for cash

Closes #14704
This commit is contained in:
Cédric Krier
2026-03-25 12:53:28 +01:00
parent 0f5f326964
commit 72a2aa648b
+5 -1
View File
@@ -13,7 +13,11 @@ class Currency(metaclass=PoolMeta):
cash_rounding = fields.Numeric(
"Cash Rounding Factor",
digits=(None, Eval('digits', None)))
digits=(None, Eval('digits', None)),
domain=['OR',
('cash_rounding', '=', None),
('cash_rounding', '>', 0),
])
def cash_round(self, amount, rounding=ROUND_HALF_EVEN, opposite=False):
if opposite: