changeset c804e958f11d in modules/account_invoice:6.0
details: 
https://hg.tryton.org/modules/account_invoice?cmd=changeset&node=c804e958f11d
description:
        Use 1 as value when taxes_deductible_rate is None

        issue10453
        review353561002
        (grafted from cfe4f7653a5b553c174c3bf426579fe32cb2d51a)
diffstat:

 invoice.py |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r b69270be4e9a -r c804e958f11d invoice.py
--- a/invoice.py        Mon May 03 15:47:26 2021 +0200
+++ b/invoice.py        Wed May 26 23:52:30 2021 +0200
@@ -2022,7 +2022,9 @@
                 * (self.unit_price or Decimal('0.0')))
             invoice_type = (
                 self.invoice.type if self.invoice else self.invoice_type)
-            if invoice_type == 'in' and self.taxes_deductible_rate != 1:
+            if (invoice_type == 'in'
+                    and self.taxes_deductible_rate is not None
+                    and self.taxes_deductible_rate != 1):
                 with Transaction().set_context(_deductible_rate=1):
                     tax_amount = sum(
                         t['amount'] for t in self._get_taxes().values())
@@ -2075,6 +2077,8 @@
                 deductible_rate = context['_deductible_rate']
             else:
                 deductible_rate = getattr(self, 'taxes_deductible_rate', 1)
+            if deductible_rate is None:
+                deductible_rate = 1
             if not deductible_rate:
                 return []
         else:

Reply via email to