From 5a016ca2938445184994f0942969577ae6f7bbd0 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 19 Jan 2009 00:35:03 +0100 Subject: [PATCH] modifs bzr revid: fp@tinyerp.com-20090118233503-cuu9w0iv999ic8xa --- addons/account/account.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 5ca933e06ac..0d25aa2cea8 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1230,8 +1230,8 @@ class account_tax(osv.osv): 'sequence': fields.integer('Sequence', required=True, help="The sequence field is used to order the taxes lines from the lowest sequences to the higher ones. The order is important if you have a tax that have several tax childs. In this case, the evaluation order is important."), 'amount': fields.float('Amount', required=True, digits=(14,4)), 'active': fields.boolean('Active'), - 'type': fields.selection( [('percent','Percent'), ('fixed','Fixed'), ('none','None'), ('code','Python Code'),('balance','Balance')], 'Tax Type', required=True, - help="The computation method for the tax amount. Balance can be used on child taxes only."), + 'type': fields.selection( [('percent','Percent'), ('fixed','Fixed'), ('none','None'), ('code','Python Code')], 'Tax Type', required=True, + help="The computation method for the tax amount."), 'applicable_type': fields.selection( [('true','True'), ('code','Python Code')], 'Applicable Type', required=True, help="If not applicable (computed through a Python code), the tax do not appears on the invoice."), 'domain':fields.char('Domain', size=32, help="This field is only used if you develop your own module allowing developpers to create specific taxes in a custom domain."), @@ -1346,8 +1346,6 @@ class account_tax(osv.osv): exec tax.python_compute in localdict amount = localdict['result'] data['amount'] = amount - elif tax.type=='balance': - data['amount'] = cur_price_unit - reduce(lambda x, y: x+y.get('amount',0.0), res, 0.0) amount2 = data['amount'] if len(tax.child_ids): if tax.child_depend: @@ -1371,6 +1369,8 @@ class account_tax(osv.osv): latest[name+'_code_id'] = False if tax.include_base_amount: cur_price_unit+=amount2 + for r in res: + print 'result', r['amount'], r['price_unit'] return res def compute(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None): @@ -1415,8 +1415,6 @@ class account_tax(osv.osv): localdict = {'price_unit':cur_price_unit, 'address':address, 'product':product, 'partner':partner} exec tax.python_compute_inv in localdict amount = localdict['result'] - elif tax.type=='balance': - data['amount'] = cur_price_unit - reduce(lambda x, y: x+y.get('amount',0.0), res, 0.0) if tax.include_base_amount: cur_price_unit -= amount