[CRITICAL] Payable & Receivable not calculate if (debit or credit) sum is NULL
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.
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.
Related branches
- OpenERP Core Team: Pending requested
-
Diff: 23 lines (+4/-2)1 file modifiedaccount/account_move_line.py (+4/-2)
summary: |
- [CRITICAL] Missing payable & receivable + [CRITICAL] Payable & Receivable not calculate if (debit or credit) sum + is NULL |
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!