c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #37101
[Bug 885714] Re: [CRITICAL] Payable & Receivable not calculate if (debit or credit) sum is NULL
trunk r5600
** Changed in: openobject-addons
Status: Incomplete => Fix Released
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP Project Group.
https://bugs.launchpad.net/bugs/885714
Title:
[CRITICAL] Payable & Receivable not calculate if (debit or credit)
sum is NULL
Status in OpenERP Addons (modules):
Fix Released
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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/885714/+subscriptions
References