[FIX] account: tax amount for include_base_amount
The tax_amount on account.move.line generated from the validation of an invoice did not include the taxes with 'include in base amount' enabled. Instead of using the line total, use the price_unit of the tax which is correctly computed through compute_all method. Fixes #5939
This commit is contained in:
parent
78a20a3dba
commit
d83befdb0f
|
@ -1414,10 +1414,10 @@ class account_invoice_line(models.Model):
|
|||
for tax in taxes:
|
||||
if inv.type in ('out_invoice', 'in_invoice'):
|
||||
tax_code_id = tax['base_code_id']
|
||||
tax_amount = line.price_subtotal * tax['base_sign']
|
||||
tax_amount = tax['price_unit'] * line.quantity * tax['base_sign']
|
||||
else:
|
||||
tax_code_id = tax['ref_base_code_id']
|
||||
tax_amount = line.price_subtotal * tax['ref_base_sign']
|
||||
tax_amount = tax['price_unit'] * line.quantity * tax['ref_base_sign']
|
||||
|
||||
if tax_code_found:
|
||||
if not tax_code_id:
|
||||
|
|
Loading…
Reference in New Issue