[FIX] mrp: do not show completed move lines in produce wizard

This commit is contained in:
Pierre Masereel
2017-09-29 11:30:56 +02:00
parent f106e59b15
commit 915b74e181
+3 -2
View File
@@ -40,9 +40,10 @@ class MrpProductProduce(models.TransientModel):
for move in production.move_raw_ids.filtered(lambda x: (x.product_id.tracking != 'none') and x.state not in ('done', 'cancel') and x.bom_line_id):
qty_to_consume = todo_quantity / move.bom_line_id.bom_id.product_qty * move.bom_line_id.product_qty
for move_line in move.move_line_ids:
if float_compare(qty_to_consume, 0.0, precision_rounding=move.product_uom.rounding) < 0\
or move_line.product_id.tracking == 'serial' and move_line.qty_done != 0:
if float_compare(qty_to_consume, 0.0, precision_rounding=move.product_uom.rounding) < 0:
break
if float_compare(move_line.product_uom_qty, move_line.qty_done, precision_rounding=move.product_uom.rounding) < 0:
continue
to_consume_in_line = min(qty_to_consume, move_line.product_uom_qty)
lines.append({
'move_id': move.id,