← Back to team overview

openerp-india team mailing list archive

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

 

** Branch linked: lp:~credativ/openobject-addons/fix-885714-6.0

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/885714

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

Status in OpenERP Addons (modules):
  New

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