[FIX] account: Corrects error on unchecking account active in _compute method
lp bug: https://launchpad.net/bugs/781701 fixed bzr revid: vro@tinyerp.com-20110517054508-cm70cacd6iyev93t
This commit is contained in:
@@ -249,6 +249,7 @@ class account_account(osv.osv):
|
||||
children_and_consolidated = self._get_children_and_consol(cr, uid, ids, context=context)
|
||||
#compute for each account the balance/debit/credit from the move lines
|
||||
accounts = {}
|
||||
sums = {}
|
||||
if children_and_consolidated:
|
||||
aml_query = self.pool.get('account.move.line')._query_get(cr, uid, context=context)
|
||||
|
||||
@@ -284,7 +285,6 @@ class account_account(osv.osv):
|
||||
# consolidate accounts with direct children
|
||||
children_and_consolidated.reverse()
|
||||
brs = list(self.browse(cr, uid, children_and_consolidated, context=context))
|
||||
sums = {}
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
while brs:
|
||||
current = brs[0]
|
||||
@@ -305,11 +305,11 @@ class account_account(osv.osv):
|
||||
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:
|
||||
res[id] = sums.get(id, null_result)
|
||||
return res
|
||||
res = {}
|
||||
null_result = dict((fn, 0.0) for fn in field_names)
|
||||
for id in ids:
|
||||
res[id] = sums.get(id, null_result)
|
||||
return res
|
||||
|
||||
def _get_company_currency(self, cr, uid, ids, field_name, arg, context=None):
|
||||
result = {}
|
||||
|
||||
Reference in New Issue
Block a user