← Back to team overview

openerp-india team mailing list archive

[Bug 1277612] [NEW] sale order line invoice status is wrong

 

Public bug reported:

1 Create a draft invoice for a sale order
2 Cancel the draf invoice but do not delete it
3 Recreate a draft invoude for the sale order
4 The invoiced status of the sale order line will be 'false', and the lines will stay to-be invoiced in the "Order Lines to Invoice" screen


Code in  addons/sale/saly.py:

    def _fnct_line_invoiced(self, cr, uid, ids, field_name, args, context=None):
        res = dict.fromkeys(ids, False)
        for this in self.browse(cr, uid, ids, context=context):
            res[this.id] = this.invoice_lines and \
                all(iline.invoice_id.state != 'cancel' for iline in this.invoice_lines) 
        return res

I think the all() check is wrong, it should check if there is at least
one invoice record with status not cancelled.

** Affects: openobject-addons
     Importance: Undecided
         Status: New

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

Title:
  sale order line invoice status is wrong

Status in OpenERP Addons (modules):
  New

Bug description:
  1 Create a draft invoice for a sale order
  2 Cancel the draf invoice but do not delete it
  3 Recreate a draft invoude for the sale order
  4 The invoiced status of the sale order line will be 'false', and the lines will stay to-be invoiced in the "Order Lines to Invoice" screen

  
  Code in  addons/sale/saly.py:

      def _fnct_line_invoiced(self, cr, uid, ids, field_name, args, context=None):
          res = dict.fromkeys(ids, False)
          for this in self.browse(cr, uid, ids, context=context):
              res[this.id] = this.invoice_lines and \
                  all(iline.invoice_id.state != 'cancel' for iline in this.invoice_lines) 
          return res

  I think the all() check is wrong, it should check if there is at least
  one invoice record with status not cancelled.

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


Follow ups

References