[FIX] account: fixed _sum() on account.tax.code object. Thanks Noviat for the patch
bzr revid: qdp-launchpad@openerp.com-20110505144340-azftlojg69zbo2sc
This commit is contained in:
parent
12de5a891b
commit
dac4f6fe28
|
@ -1561,14 +1561,15 @@ class account_tax_code(osv.osv):
|
|||
(parent_ids,) + where_params)
|
||||
res=dict(cr.fetchall())
|
||||
obj_precision = self.pool.get('decimal.precision')
|
||||
res2 = {}
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
def _rec_get(record):
|
||||
amount = res.get(record.id, 0.0)
|
||||
for rec in record.child_ids:
|
||||
amount += _rec_get(rec) * rec.sign
|
||||
return amount
|
||||
res[record.id] = round(_rec_get(record), obj_precision.precision_get(cr, uid, 'Account'))
|
||||
return res
|
||||
res2[record.id] = round(_rec_get(record), obj_precision.precision_get(cr, uid, 'Account'))
|
||||
return res2
|
||||
|
||||
def _sum_year(self, cr, uid, ids, name, args, context=None):
|
||||
if context is None:
|
||||
|
|
Loading…
Reference in New Issue