[FIX] mrp: remove unreserved line first
Since the quantity producing could change on the produce wizard. The first quantity to remove is the quantity not reserved on the MO.
This commit is contained in:
@@ -63,7 +63,7 @@ class MrpAbstractWorkorder(models.AbstractModel):
|
||||
# Remove or lower quantity on exisiting workorder lines
|
||||
if float_compare(qty_todo, 0.0, precision_rounding=rounding) < 0:
|
||||
qty_todo = abs(qty_todo)
|
||||
for workorder_line in move_workorder_lines:
|
||||
for workorder_line in move_workorder_lines.sorted(key=lambda wl: wl.qty_reserved):
|
||||
if float_compare(qty_todo, 0, precision_rounding=rounding) <= 0:
|
||||
break
|
||||
if float_compare(workorder_line.qty_to_consume, qty_todo, precision_rounding=rounding) <= 0:
|
||||
|
||||
Reference in New Issue
Block a user