From daa6cea4397833ccd3e2987234d170d217006273 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 13 Sep 2018 09:51:28 +0200 Subject: [PATCH] [FIX] mrp: Upating the quantity of a MO Steps to reproduce the bug: - Create three stockable products P1, P2, P3 - Create a BOM for P1 with P2 and P3 as components - Create a MO with 5 P1 - Check the availability and plan it - Go on the WO and process only 3 P1 - Go to the MO and update the quantity to 3 Bug: From this point, it was impossible to pass the MO to the state= 'done' With this fix, you can now, click on "Post inventory" and the button "Mark as Done" will appear. opw:1874227 --- addons/mrp/wizard/change_production_qty.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/mrp/wizard/change_production_qty.py b/addons/mrp/wizard/change_production_qty.py index 4816981a1fe..cddc9101043 100644 --- a/addons/mrp/wizard/change_production_qty.py +++ b/addons/mrp/wizard/change_production_qty.py @@ -77,6 +77,8 @@ class ChangeProductionQty(models.TransientModel): wo.qty_producing = quantity if wo.qty_produced < wo.qty_production and wo.state == 'done': wo.state = 'progress' + if wo.qty_produced == wo.qty_production and wo.state == 'progress': + wo.state = 'done' # assign moves; last operation receive all unassigned moves # TODO: following could be put in a function as it is similar as code in _workorders_create # TODO: only needed when creating new moves