summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStéphane Bidoul <stephane.bidoul@acsone.eu>2015-03-25 13:22:31 +0100
committerMartin Trigaux <mat@odoo.com>2015-05-12 16:07:24 +0200
commitd83befdb0f4cdc34f1d2aad7f91f07efe7d3bccf (patch)
tree9acd17e1a9b21cbc8be98cf32082af4de85c2274
parent78a20a3dba07762d2de1e22072c20be1bc59d20f (diff)
[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
-rw-r--r--addons/account/account_invoice.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index 4da3e85c6b6..02ab5189c1e 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -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: