[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.
This commit is contained in:
Josse Colpaert
2016-10-02 21:12:56 +02:00
parent 157db49d9c
commit 8ec7c00e1e
2 changed files with 2 additions and 0 deletions
@@ -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
@@ -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),