From ea0c5475dee914e9a9d34f535153356a2ff45e68 Mon Sep 17 00:00:00 2001 From: Lois Rilo Date: Tue, 6 Mar 2018 14:24:24 +0100 Subject: [PATCH] [10.0][FIX] mrp_production_request: issue propagating context to undesired places --- .../tests/test_mrp_production_request.py | 8 ++------ .../views/mrp_production_request_view.xml | 1 - .../wizards/mrp_production_request_create_mo.py | 14 +++++++++++++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/mrp_production_request/tests/test_mrp_production_request.py b/mrp_production_request/tests/test_mrp_production_request.py index 5b480f6cc..3628888d5 100644 --- a/mrp_production_request/tests/test_mrp_production_request.py +++ b/mrp_production_request/tests/test_mrp_production_request.py @@ -51,9 +51,7 @@ class TestMrpProductionRequest(TransactionCase): request.button_to_approve() request.button_approved() self.assertEqual(request.pending_qty, 4.0) - wiz = self.wiz_model.create({ - 'mrp_production_request_id': request.id, - }) + wiz = self.wiz_model.with_context(active_ids=request.ids).create({}) wiz.compute_product_line_ids() wiz.mo_qty = 4.0 wiz.create_mo() @@ -68,9 +66,7 @@ class TestMrpProductionRequest(TransactionCase): request and not from manufacturing order.""" proc = self.create_procurement('TEST/02', self.product) request = proc.mrp_production_request_id - wiz = self.wiz_model.create({ - 'mrp_production_request_id': request.id, - }) + wiz = self.wiz_model.with_context(active_ids=request.ids).create({}) wiz.mo_qty = 4.0 wiz.create_mo() with self.assertRaises(UserError): diff --git a/mrp_production_request/views/mrp_production_request_view.xml b/mrp_production_request/views/mrp_production_request_view.xml index a1da0c212..cb97907e8 100644 --- a/mrp_production_request/views/mrp_production_request_view.xml +++ b/mrp_production_request/views/mrp_production_request_view.xml @@ -21,7 +21,6 @@ string="Approve" type="object" class="oe_highlight" groups="mrp_production_request.group_mrp_production_request_manager"/>