[FIX] purchase: invoiced purchase order line

When invoice_method == 'picking', a po line is invoiced if all the lines
linked to the po line are in invoices with state not in ['draft', 'cancel'].
To keep the same logic than before commit 9b1ab76.

opw:649746
This commit is contained in:
Goffin Simon 2015-09-22 17:19:19 +02:00
parent 9e53f04332
commit bdcae86d67
1 changed files with 2 additions and 1 deletions

View File

@ -1014,7 +1014,8 @@ class purchase_order(osv.osv):
if (po_line.move_ids and
all(move.state in ('done', 'cancel') for move in po_line.move_ids) and
not all(move.state == 'cancel' for move in po_line.move_ids) and
all(move.invoice_state == 'invoiced' for move in po_line.move_ids if move.state == 'done')):
all(move.invoice_state == 'invoiced' for move in po_line.move_ids if move.state == 'done')
and po_line.invoice_lines and all(line.invoice_id.state not in ['draft', 'cancel'] for line in po_line.invoice_lines)):
is_invoiced.append(po_line.id)
else:
for po_line in po.order_line: