summaryrefslogtreecommitdiff
path: root/addons/mrp/tests/test_multicompany.py
diff options
context:
space:
mode:
authorWilliam Henrotin <whe@odoo.com>2020-04-27 11:56:02 +0200
committerSimon Lejeune <sle@openerp.com>2020-06-15 16:59:41 +0200
commit0e2765f5fd0ca0079f1f024ec3a1448b6d2ea3db (patch)
tree90ea03d1aca1bf87a080775e7db07977b645c5cc /addons/mrp/tests/test_multicompany.py
parent1b6421285c6bc4c61be3242cea30c2813251cbc7 (diff)
[REF] mrp: no more produce wizard
Use a view similar as the pickings one. task-2241471
Diffstat (limited to 'addons/mrp/tests/test_multicompany.py')
-rw-r--r--addons/mrp/tests/test_multicompany.py26
1 files changed, 12 insertions, 14 deletions
diff --git a/addons/mrp/tests/test_multicompany.py b/addons/mrp/tests/test_multicompany.py
index b6593cfb517..6b0c3fd3a47 100644
--- a/addons/mrp/tests/test_multicompany.py
+++ b/addons/mrp/tests/test_multicompany.py
@@ -133,15 +133,10 @@ class TestMrpMulticompany(common.TransactionCase):
})
mo_form = Form(self.env['mrp.production'].with_user(self.user_a))
mo_form.product_id = product
+ mo_form.lot_producing_id = lot_b
mo = mo_form.save()
- mo.with_user(self.user_b).action_confirm()
- produce_form = Form(self.env['mrp.product.produce'].with_user(self.user_b).with_context({
- 'active_id': mo.id,
- 'active_ids': [mo.id],
- }))
- produce_form.finished_lot_id = lot_b
with self.assertRaises(UserError):
- produce_form.save()
+ mo.with_user(self.user_b).action_confirm()
def test_product_produce_2(self):
"""Check that using a component lot of company b in the produce wizard of a production
@@ -168,14 +163,17 @@ class TestMrpMulticompany(common.TransactionCase):
mo_form.product_id = product
mo = mo_form.save()
mo.with_user(self.user_b).action_confirm()
- produce_form = Form(self.env['mrp.product.produce'].with_user(self.user_b).with_context({
- 'active_id': mo.id,
- 'active_ids': [mo.id],
- }))
- with produce_form.raw_workorder_line_ids.edit(0) as line:
- line.lot_id = lot_b
+ mo_form = Form(mo)
+ mo_form.qty_producing = 1
+ mo = mo_form.save()
+ details_operation_form = Form(mo.move_raw_ids[0], view=self.env.ref('stock.view_stock_move_operations'))
+ with details_operation_form.move_line_ids.edit(0) as ml:
+ ml.lot_id = lot_b
+ ml.qty_done = 1
+ details_operation_form.save()
with self.assertRaises(UserError):
- produce_form.save()
+ mo.button_mark_done()
+
def test_partner_1(self):
""" On a product without company, as a user of Company B, check it is not possible to use a