From 8aa6aa0c785b006a11b702d6052745d87b058902 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 6 May 2015 18:17:45 +0200 Subject: [PATCH] [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 --- addons/account/report/account_entries_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/report/account_entries_report.py b/addons/account/report/account_entries_report.py index 6dd451599b4..0520a16c64a 100644 --- a/addons/account/report/account_entries_report.py +++ b/addons/account/report/account_entries_report.py @@ -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)