[CRITICAL] Payable & Receivable not calculate if (debit or credit) sum is NULL

Bug #885714 reported by Dimitri John Ledkov (ex-credativ)
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

If debit or credit is NULL in account move lines is zero, partner payable/receivable balance and the aged partner balance report is wrong as well.

* there is no 'not null' constraints on debit/credit fields on the account_move_lines
* if you do csv import with those fields as "blank" they get imported as NULL into the database
* the sql query which calculates payble/receivable balance is in SQL
 "SUM(l.debit-l.credit)"

If one of the fields is null, the returned value is also null, instead of proper balance!

  # select 100.00-NULL as "subtract_NULL", 100.00-0.00 as "subtract_ZERO";
   subtract_NULL | subtract_ZERO
  ---------------+---------------
                 | 100.00
  (1 row)

Because there is no "not null" constraint the other sql-check which was supposed to catch just plain doesn't work.

I'll push a patch for this issue.

summary: - [CRITICAL] Missing payable & receivable
+ [CRITICAL] Payable & Receivable not calculate if (debit or credit) sum
+ is NULL
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Dmitrijs,

I have checked your issue at my end. But I am not able to reproduce it.

Because debit and credit are float field so It will never became null. You are suggested that the import value from csv but these two field are not "Import compatible".

So Would you please provide more information or precious steps to reproduce it.

Thanks and waiting for your reply!

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

trunk r5600

Changed in openobject-addons:
status: Incomplete → 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.