From 4102f38f15bd3a43b1ca4c9a67c63abe4869b16f Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Thu, 3 May 2018 12:04:46 +0200 Subject: [PATCH] [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. --- addons/mrp/wizard/mrp_product_produce.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/mrp/wizard/mrp_product_produce.py b/addons/mrp/wizard/mrp_product_produce.py index 15c1684561e..d2ce72c3d48 100644 --- a/addons/mrp/wizard/mrp_product_produce.py +++ b/addons/mrp/wizard/mrp_product_produce.py @@ -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