Do not compare base to 0 if it is None

issue10657
review369471002
This commit is contained in:
Cédric Krier committed 2021-08-19 22:32:48 +02:00
1 parent 857dc2be6d
commit e3ba424efe
1 file changed
+5 -4
+5 -4
View File
@@ -2564,10 +2564,11 @@ class InvoiceTax(sequence_ordered(), ModelSQL, ModelView):
with Transaction().set_context(**context):
tax = Tax(self.tax.id)
self.description = tax.description
if self.base >= 0:
self.account = tax.invoice_account
else:
self.account = tax.credit_note_account
if self.base is not None:
if self.base >= 0:
self.account = tax.invoice_account
else:
self.account = tax.credit_note_account
@fields.depends('tax', 'base', 'amount', 'manual', 'invoice',
'_parent_invoice.currency')