Use tax sequence as default value for invoice taxes sequence

issue6793
review40691002
This commit is contained in:
Sergi Almacellas Abellana committed 2017-10-02 10:17:35 +02:00
1 parent 08b600ccae
commit 2ad0d23e06
2 files changed
+5 -1

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
* Use tax sequence as default value for invoice taxes sequence
* Add party tax identifier on invoice
Version 4.4.0 - 2017-05-01
+4 -1
View File
@@ -556,7 +556,10 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin):
self.tax_amount += computed_taxes[key]['amount']
value = InvoiceTax.default_get(InvoiceTax._fields.keys())
value.update(computed_taxes[key])
taxes.append(InvoiceTax(**value))
invoice_tax = InvoiceTax(**value)
if invoice_tax.tax:
invoice_tax.sequence = invoice_tax.tax.sequence
taxes.append(invoice_tax)
self.taxes = taxes
if self.currency:
self.untaxed_amount = self.currency.round(self.untaxed_amount)