Support accounts on tax of type 'none'

And update the account of invoice tax if the base change.

issue10656
review334711002
This commit is contained in:
Cédric Krier committed 2021-08-27 09:03:48 +02:00
1 parent 5797a9a192
commit 8f3a9291c3
1 file changed
+8
+8
View File
@@ -2602,6 +2602,14 @@ class InvoiceTax(sequence_ordered(), ModelSQL, ModelView):
else:
self.account = tax.credit_note_account
@fields.depends('base', 'tax')
def on_change_base(self):
if self.base is not None and self.tax:
if self.base >= 0:
self.account = self.tax.invoice_account
else:
self.account = self.tax.credit_note_account
@fields.depends('tax', 'base', 'amount', 'manual', 'invoice',
'_parent_invoice.currency')
def on_change_with_amount(self):