From d4301f1451cefc79980bd0e52ad55527e35b2604 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 23 Oct 2007 17:58:02 +0000 Subject: [PATCH] Bugfix in Balance Computation: BUG #240 bzr revid: fp@tinyerp.com-5107cda858fd3eabb168e424e39cc31e85a76033 --- addons/account/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index 9e1f92dffe5..38e445a1b6e 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -183,7 +183,7 @@ class account_account(osv.osv): ids2 = {}.fromkeys(ids + ids2).keys() acc_set = ",".join(map(str, ids2)) query = self.pool.get('account.move.line')._query_get(cr, uid, context=context) - cr.execute(("SELECT a.id, COALESCE(SUM((l.debit-l.credit)),0) FROM account_account a LEFT JOIN account_move_line l ON (a.id=l.account_id) WHERE a.id IN (%s) and "+query+" GROUP BY a.id") % (acc_set, )) + cr.execute(("SELECT a.id, SUM((COALESCE(l.debit,0)-COALESCE(l.credit,0))) FROM account_account a LEFT JOIN account_move_line l ON (a.id=l.account_id) WHERE a.id IN (%s) and "+query+" GROUP BY a.id") % (acc_set, )) res = {} for account_id, sum in cr.fetchall(): res[account_id] = round(sum,2)