[FIX] Account balance is incorrect

lp bug: https://launchpad.net/bugs/310569 fixed

bzr revid: stephane@tinyerp.com-20081222152636-9bqzl0iggm8j2wd9
This commit is contained in:
Stephane Wirtel 2008-12-22 16:26:36 +01:00
parent 2d9483b97f
commit 7fcf65d7c5
1 changed files with 1 additions and 1 deletions

View File

@ -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 "
}