From 5a78462f90d73276fc4e3c2c6c2928252f79428a Mon Sep 17 00:00:00 2001 From: amoyaux Date: Thu, 3 Aug 2017 17:14:41 +0200 Subject: [PATCH] [IMP] mrp : usability for produce wizard On the production wizard when you are using a product tracked by SN/lot and another not tracked as consumed element. You edit the form view by settings the correct quantity -> Use the produce wizard. It will display the tracked product (you can see the details you entered before) -> validate. It will double the quantity done for the not tracked product. This commit will change the wizard behavior by only set the quantity done on untracked product if it is not already set. --- addons/mrp/wizard/mrp_product_produce.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/wizard/mrp_product_produce.py b/addons/mrp/wizard/mrp_product_produce.py index d0e4837c1d5..b887ac2a62d 100644 --- a/addons/mrp/wizard/mrp_product_produce.py +++ b/addons/mrp/wizard/mrp_product_produce.py @@ -82,7 +82,7 @@ class MrpProductProduce(models.TransientModel): quantity = self.product_qty if float_compare(quantity, 0, precision_rounding=self.product_uom_id.rounding) <= 0: raise UserError(_('You should at least produce some quantity')) - for move in moves.filtered(lambda x: x.product_id.tracking == 'none' and x.state not in ('done', 'cancel')): + for move in moves.filtered(lambda x: x.product_id.tracking == 'none' and x.quantity_done == 0 and x.state not in ('done', 'cancel')): if move.unit_factor: rounding = move.product_uom.rounding move.quantity_done += float_round(quantity * move.unit_factor, precision_rounding=rounding)