[FIX] account: fix tax_ids computation on aml creation from invoice.
In case of a tax affecting subsequent taxes, the tax_ids field was wrongly set which led to errors in VAT reports. OPW 757072.
This commit is contained in:
@@ -697,7 +697,6 @@ class AccountInvoice(models.Model):
|
||||
if tax.amount_type == "group":
|
||||
for child_tax in tax.children_tax_ids:
|
||||
done_taxes.append(child_tax.id)
|
||||
done_taxes.append(tax.id)
|
||||
res.append({
|
||||
'invoice_tax_line_id': tax_line.id,
|
||||
'tax_line_id': tax_line.tax_id.id,
|
||||
@@ -709,8 +708,9 @@ class AccountInvoice(models.Model):
|
||||
'account_id': tax_line.account_id.id,
|
||||
'account_analytic_id': tax_line.account_analytic_id.id,
|
||||
'invoice_id': self.id,
|
||||
'tax_ids': [(6, 0, done_taxes)] if tax_line.tax_id.include_base_amount else []
|
||||
'tax_ids': [(6, 0, list(done_taxes))] if tax_line.tax_id.include_base_amount else []
|
||||
})
|
||||
done_taxes.append(tax.id)
|
||||
return res
|
||||
|
||||
def inv_line_characteristic_hashcode(self, invoice_line):
|
||||
|
||||
Reference in New Issue
Block a user