[FIX] account: entries analysis with null values in debit/credit

In SQL, the addition/subtraction between NULL and an integer/numeric
returns NULL.

Therefore, if either debit or credit was set to null instead
of 0.0, debit-credit returned null, instead of the actual subtraction

opw-634044
This commit is contained in:
Denis Ledoux 2015-05-06 18:17:45 +02:00
parent 567ade56df
commit 8aa6aa0c78
1 changed files with 1 additions and 1 deletions

View File

@ -145,7 +145,7 @@ class account_entries_report(osv.osv):
l.amount_currency as amount_currency,
l.debit as debit,
l.credit as credit,
l.debit-l.credit as balance
coalesce(l.debit, 0.0) - coalesce(l.credit, 0.0) as balance
from
account_move_line l
left join account_account a on (l.account_id = a.id)