changeset f1a3f09741d6 in modules/account:6.0
details: https://hg.tryton.org/modules/account?cmd=changeset&node=f1a3f09741d6
description:
        Invert sign of credit instead of using absolute value of tax code

        Since issue9743 the summed amounts of tax line can have different signs 
so we
        can not use anymore the absolute value.

        issue11242
        review360901002
        (grafted from 75866feec26664d4165dcb845fe2c9d9c5be738f)
diffstat:

 tax.py |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r a1732fb6caad -r f1a3f09741d6 tax.py
--- a/tax.py    Thu Feb 17 00:08:07 2022 +0100
+++ b/tax.py    Mon Feb 21 00:57:41 2022 +0100
@@ -411,7 +411,8 @@
     @property
     def value(self):
         value = getattr(self.tax, '%s_%s_amount' % (self.type, self.amount))
-        value = abs(value)
+        if self.type == 'credit':
+            value *= -1
         if self.operator == '-':
             value *= -1
         return value

Reply via email to