From d83befdb0f4cdc34f1d2aad7f91f07efe7d3bccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 25 Mar 2015 13:22:31 +0100 Subject: [PATCH] [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 --- addons/account/account_invoice.py | 4 ++-- 1 file 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: