details:   https://code.tryton.org/tryton/commit/b8c6c0ce6464
branch:    6.0
user:      Cédric Krier <[email protected]>
date:      Mon Mar 02 15:23:13 2026 +0100
description:
        Use currency rounding when currency has no cash rounding set

        Closes #14638
        (grafted from c2e82186e7089618939ae9270490a68d2ca17622)
diffstat:

 modules/account_cash_rounding/currency.py |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r ce81f12c9444 -r b8c6c0ce6464 modules/account_cash_rounding/currency.py
--- a/modules/account_cash_rounding/currency.py Wed Mar 04 12:36:33 2026 +0100
+++ b/modules/account_cash_rounding/currency.py Mon Mar 02 15:23:13 2026 +0100
@@ -16,4 +16,8 @@
         depends=['digits'])
 
     def cash_round(self, amount, rounding=ROUND_HALF_EVEN):
-        return self._round(amount, self.cash_rounding, rounding)
+        if self.cash_rounding is not None:
+            factor = self.cash_rounding
+        else:
+            factor = self.rounding
+        return self._round(amount, factor, rounding)

Reply via email to