From 7fcf65d7c545b1f966cac1496545a69312ffde4f Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Mon, 22 Dec 2008 16:26:36 +0100 Subject: [PATCH] [FIX] Account balance is incorrect lp bug: https://launchpad.net/bugs/310569 fixed bzr revid: stephane@tinyerp.com-20081222152636-9bqzl0iggm8j2wd9 --- 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 997fe2b3c59..86d7ac16c68 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -179,7 +179,7 @@ class account_account(osv.osv): def __compute(self, cr, uid, ids, field_names, arg, context={}, query=''): #compute the balance/debit/credit accordingly to the value of field_name for the given account ids mapping = { - 'balance': "COALESCE(SUM(l.debit) - SUM(l.credit), 0) as balance ", + 'balance': "COALESCE(SUM(l.debit),0) - COALESCE(SUM(l.credit), 0) as balance ", 'debit': "COALESCE(SUM(l.debit), 0) as debit ", 'credit': "COALESCE(SUM(l.credit), 0) as credit " }