From 72a2aa648bd10dfe905b0ceb3c040e42eb7a3fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 25 Mar 2026 12:53:28 +0100 Subject: [PATCH] Enforce strictly positive rounding value for cash Closes #14704 --- modules/account_cash_rounding/currency.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/account_cash_rounding/currency.py b/modules/account_cash_rounding/currency.py index 1fa4d99598..a5c85b7592 100644 --- a/modules/account_cash_rounding/currency.py +++ b/modules/account_cash_rounding/currency.py @@ -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: