account.account balance is incorrect if sum(debit) or sum(credit) is null (trunk)

Bug #310569 reported by Dukai Gábor
2
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

Hi!
Trunk version.
If in a financial account there are only credit or only debit entries, the balance is computed incorrectly as zero.
This is because some null value checking is missing in the sql query.

In account.account.__compute()
mapping has
'balance': "COALESCE(SUM(l.debit) - SUM(l.credit), 0) as balance ",
at this moment but it should be
'balance': "COALESCE(SUM(l.debit), 0) - COALESCE(SUM(l.credit), 0) as balance ",

Dukai Gábor (gdukai)
description: updated
Changed in openobject-addons:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.