From 6127d931f3b19f62269943c094b59bec87c878f9 Mon Sep 17 00:00:00 2001 From: mtr Date: Mon, 31 Jan 2011 12:06:45 +0530 Subject: [PATCH] [FIX] account: allows duplication of account lp bug: https://launchpad.net/bugs/708603 fixed bzr revid: mtr@mtr-20110131063645-pjwyyj3uv1jp40i1 --- addons/account/account.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index bd0839243a5..e9b0c9e7905 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -300,13 +300,12 @@ class account_account(osv.osv): brs.pop(0) for fn in field_names: sums.setdefault(current.id, {})[fn] = accounts.get(current.id, {}).get(fn, 0.0) - if current.child_id: - for child in current.child_id: - if child.company_id.currency_id.id == current.company_id.currency_id.id: - if sums.get(child.id): - sums[current.id][fn] += sums[child.id][fn] - else: - sums[current.id][fn] += currency_obj.compute(cr, uid, child.company_id.currency_id.id, current.company_id.currency_id.id, sums[child.id][fn], context=context) + for child in current.child_id: + if child.company_id.currency_id.id == current.company_id.currency_id.id: + if sums.get(child.id, False): + sums[current.id][fn] += sums[child.id][fn] + else: + sums[current.id][fn] += currency_obj.compute(cr, uid, child.company_id.currency_id.id, current.company_id.currency_id.id, sums[child.id][fn], context=context) res = {} null_result = dict((fn, 0.0) for fn in field_names) for id in ids: