From 2f89489e9283095f3b32f2e27c8e00d0d93310a8 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Thu, 16 Feb 2012 20:11:07 +0100 Subject: [PATCH] [REV] account: revert incorrect code merged at r.5623 for bug 889106 - this break normal onchange behavior r.5623 = fp@tinyerp.com-20111111195417-fqu7vq56g5az4h6y bzr revid: odo@openerp.com-20120216191107-l300saavd8kndyhs --- addons/account/account_invoice.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 36fb20559ed..5e5ac5f482b 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1362,17 +1362,6 @@ class account_invoice_line(osv.osv): taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False) tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes) - if type in ('in_invoice','in_refund') and tax_id and price_unit: - tax_pool = self.pool.get('account.tax') - tax_browse = tax_pool.browse(cr, uid, tax_id) - if not isinstance(tax_browse, list): - tax_browse = [tax_browse] - taxes = tax_pool.compute_inv(cr, uid, tax_browse, price_unit, 1) - tax_amount = reduce(lambda total, tax_dict: total + tax_dict.get('amount', 0.0), taxes, 0.0) - price_unit = price_unit - tax_amount - if qty != 0: - price_unit = price_unit / float(qty) - if type in ('in_invoice', 'in_refund'): result.update( {'price_unit': price_unit or res.standard_price,'invoice_line_tax_id': tax_id} ) else: