changeset 75866feec266 in modules/account:default
details: https://hg.tryton.org/modules/account?cmd=changeset&node=75866feec266
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
diffstat:

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

diffs (13 lines):

diff -r 2f6c83d6f7ab -r 75866feec266 tax.py
--- a/tax.py    Tue Feb 15 00:08:46 2022 +0100
+++ b/tax.py    Mon Feb 21 00:57:41 2022 +0100
@@ -403,7 +403,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