sale order line invoice status is wrong

Bug #1277612 reported by Ronny Dierckx
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
New
Undecided
Unassigned

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 (replace all() with any())

Ronny Dierckx (rd-4)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.