From 39b0a4c2ccaee8f31f5dae62ff502a8bc5c2cfe9 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Fri, 7 Aug 2015 11:07:52 +0200 Subject: [PATCH] [FIX] account: tax_sign When changing manually the amount of tax in supplier invoice, the tax sign of the tax must be kept. Back-port of 4f6eebf698b78cdd2001129f231c0a0e2 opw:645691 --- addons/account/account_invoice.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 79294085488..6aa17a24c0a 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1708,7 +1708,9 @@ class account_invoice_tax(osv.osv): company_currency = company_obj.read(cr, uid, [company_id], ['currency_id'])[0]['currency_id'][0] if currency_id and company_currency: amount = cur_obj.compute(cr, uid, currency_id, company_currency, amount, context={'date': date_invoice or fields.date.context_today(self, cr, uid)}, round=False) - return {'value': {'tax_amount': amount}} + tax_rec = self.browse(cr, uid, ids) + tax_sign = (tax_rec[0].tax_amount / tax_rec[0].amount) if tax_rec and tax_rec[0].amount else 1 + return {'value': {'tax_amount': amount * tax_sign}} _order = 'sequence' _defaults = {