[FIX] mrp: round up quantity to consume in produce wizard

When moves of a MO are generated, they are rounded up to the decimal
precision of the rounding, what is not done in the wizard.

So to keep it consistent, we also round up the quantity to consume in
the wizard.
This commit is contained in:
Pierre Masereel
2018-05-03 16:25:21 +02:00
parent 8b7fb9a764
commit 4102f38f15
+2 -1
View File
@@ -38,7 +38,8 @@ class MrpProductProduce(models.TransientModel):
if 'produce_line_ids' in fields:
lines = []
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
qty_to_consume = float_round(todo_quantity / move.bom_line_id.bom_id.product_qty * move.bom_line_id.product_qty,
precision_rounding=move.product_uom.rounding, rounding_method="UP")
for move_line in move.move_line_ids:
if float_compare(qty_to_consume, 0.0, precision_rounding=move.product_uom.rounding) <= 0:
break