From 8ec7c00e1e2a7f9023f43ed507907773dad3b33b Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Sun, 2 Oct 2016 18:03:40 +0200 Subject: [PATCH] [FIX] mrp_byproduct: take into account operation where byproduct gets produced As the field is not shown in the view, it is just done because the field is still there and easy to do. --- addons/mrp/wizard/change_production_qty.py | 1 + addons/mrp_byproduct/models/mrp_production.py | 1 + 2 files changed, 2 insertions(+) diff --git a/addons/mrp/wizard/change_production_qty.py b/addons/mrp/wizard/change_production_qty.py index de98b052a81..4b895236523 100644 --- a/addons/mrp/wizard/change_production_qty.py +++ b/addons/mrp/wizard/change_production_qty.py @@ -63,6 +63,7 @@ class ChangeProductionQty(models.TransientModel): wo.state = 'progress' # assign moves; last operation receive all unassigned moves operation = wo.operation_id + # TODO: following could be put in a function as it is similar as code in _workorders_create # TODO: only needed when creating new moves diff --git a/addons/mrp_byproduct/models/mrp_production.py b/addons/mrp_byproduct/models/mrp_production.py index 924c13fc2e8..c60c67ab4f0 100644 --- a/addons/mrp_byproduct/models/mrp_production.py +++ b/addons/mrp_byproduct/models/mrp_production.py @@ -23,6 +23,7 @@ class MrpProduction(models.Model): 'product_uom': sub_product.product_uom_id.id, 'location_id': source, 'location_dest_id': production.location_dest_id.id, + 'operation_id': sub_product.operation_id.id, 'production_id': production.id, 'origin': production.name, 'unit_factor': qty1 / (production.product_qty - production.qty_produced),