details: https://code.tryton.org/tryton/commit/7e7d7774dfba
branch: default
user: Cédric Krier <[email protected]>
date: Wed Mar 25 12:53:28 2026 +0100
description:
Enforce strictly positive rounding value for cash
Closes #14704
diffstat:
modules/account_cash_rounding/currency.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diffs (16 lines):
diff -r fa337e74fc47 -r 7e7d7774dfba modules/account_cash_rounding/currency.py
--- a/modules/account_cash_rounding/currency.py Tue Mar 24 16:57:31 2026 +0100
+++ b/modules/account_cash_rounding/currency.py Wed Mar 25 12:53:28 2026 +0100
@@ -13,7 +13,11 @@
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: