diff --git a/addons/mrp_byproduct/test/mrp_byproduct.yml b/addons/mrp_byproduct/test/mrp_byproduct.yml index 6932a77183c..cd6ce885256 100644 --- a/addons/mrp_byproduct/test/mrp_byproduct.yml +++ b/addons/mrp_byproduct/test/mrp_byproduct.yml @@ -65,7 +65,9 @@ - !python {model: mrp.product.produce}: | qty = self.browse(cr, uid, ref('mrp_product_produce0')).product_qty - lines = self.on_change_qty(cr, uid, [ref('mrp_product_produce0')], qty, [], context=context) + ctx = context.copy() + ctx['active_id'] = ref("mrp_production_mo0") + lines = self.on_change_qty(cr, uid, [ref('mrp_product_produce0')], qty, [], context=ctx) self.write(cr, uid, [ref('mrp_product_produce0')], lines['value'], context=context) self.do_produce(cr, uid, [ref("mrp_product_produce0")], {"active_model": "mrp.production", "active_ids":[ref("mrp_production_mo0")], "active_id": ref("mrp_production_mo0")}) -