← Back to team overview

openerp-india team mailing list archive

[Bug 1214456] Re: account_voucher creating extra journal entries on payment

 

** Description changed:

  voucher_move_line_create function should (according to comment) skip
  over voucher lines with amount = 0 and debit=credit=0.
  
- The comment reads: 
+ The comment reads:
  "create one move line per voucher line where amount is not 0.0 AND (second part of the clause) only if the original move line was not having debit = credit = 0 (which is a legal value)"
  
  The logic is:
-  if not line.amount and 
-  not (line.move_line_id and not float_compare(line.move_line_id.debit,line.move_line_id.credit,precision_rounding=prec) and 
-  not float_compare(line.move_line_id.debit, 0.0, precision_rounding=prec)):
-     continue
+  if not line.amount and
+  not (line.move_line_id and not float_compare(line.move_line_id.debit,line.move_line_id.credit,precision_rounding=prec) and
+  not float_compare(line.move_line_id.debit, 0.0, precision_rounding=prec)):
+     continue
  
- The second step in this is returning true only if credit != debit = 0,
- which contradicts the comment and is causing extra unneccessary move
+ The second step in this is returning false credit = debit = 0, which
+ contradicts the comment and is causing extra unneccessary move
  creations, which builds upon itself every time a payment is made.
  
- I believe a fix is as simple as changing the second line to 
+ I believe a fix is as simple as changing the second line to
  (line.move_line_id and not float_compare(line.move_line_id.debit,line.move_line_id.credit,precision_rounding=prec)                    #true if credit == debit

** Description changed:

  voucher_move_line_create function should (according to comment) skip
  over voucher lines with amount = 0 and debit=credit=0.
  
  The comment reads:
  "create one move line per voucher line where amount is not 0.0 AND (second part of the clause) only if the original move line was not having debit = credit = 0 (which is a legal value)"
  
  The logic is:
   if not line.amount and
   not (line.move_line_id and not float_compare(line.move_line_id.debit,line.move_line_id.credit,precision_rounding=prec) and
   not float_compare(line.move_line_id.debit, 0.0, precision_rounding=prec)):
      continue
  
- The second step in this is returning false credit = debit = 0, which
+ The second step in this is returning false if credit = debit = 0, which
  contradicts the comment and is causing extra unneccessary move
  creations, which builds upon itself every time a payment is made.
  
  I believe a fix is as simple as changing the second line to
  (line.move_line_id and not float_compare(line.move_line_id.debit,line.move_line_id.credit,precision_rounding=prec)                    #true if credit == debit

-- 
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/1214456

Title:
  account_voucher creating extra journal entries on payment

Status in OpenERP Addons (modules):
  New

Bug description:
  voucher_move_line_create function should (according to comment) skip
  over voucher lines with amount = 0 and debit=credit=0.

  The comment reads:
  "create one move line per voucher line where amount is not 0.0 AND (second part of the clause) only if the original move line was not having debit = credit = 0 (which is a legal value)"

  The logic is:
   if not line.amount and
   not (line.move_line_id and not float_compare(line.move_line_id.debit,line.move_line_id.credit,precision_rounding=prec) and
   not float_compare(line.move_line_id.debit, 0.0, precision_rounding=prec)):
      continue

  The second step in this is returning false if credit = debit = 0,
  which contradicts the comment and is causing extra unneccessary move
  creations, which builds upon itself every time a payment is made.

  I believe a fix is as simple as changing the second line to
  (line.move_line_id and not float_compare(line.move_line_id.debit,line.move_line_id.credit,precision_rounding=prec)                    #true if credit == debit

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1214456/+subscriptions


References