mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[MIG] mrp_multi_level: finish migration of test
This commit is contained in:
@@ -278,21 +278,21 @@ class TestMrpMultiLevel(TestMrpMultiLevelCommon):
|
|||||||
week_2_expected = sum(moves_demand[3:].mapped("mrp_qty"))
|
week_2_expected = sum(moves_demand[3:].mapped("mrp_qty"))
|
||||||
self.assertIn(abs(week_2_expected), quantities)
|
self.assertIn(abs(week_2_expected), quantities)
|
||||||
|
|
||||||
# def test_09_isolated_mrp_area_run(self):
|
def test_09_isolated_mrp_area_run(self):
|
||||||
# """Test running MRP for just one area."""
|
"""Test running MRP for just one area."""
|
||||||
# self.mrp_multi_level_wiz.with_user(self.mrp_manager).create(
|
self.mrp_multi_level_wiz.with_user(self.mrp_manager).create(
|
||||||
# {"mrp_area_ids": [(6, 0, self.secondary_area.ids)]}
|
{"mrp_area_ids": [(6, 0, self.secondary_area.ids)]}
|
||||||
# ).run_mrp_multi_level()
|
).run_mrp_multi_level()
|
||||||
# this = self.mrp_inventory_obj.search(
|
this = self.mrp_inventory_obj.search(
|
||||||
# [("mrp_area_id", "=", self.secondary_area.id)], limit=1
|
[("mrp_area_id", "=", self.secondary_area.id)], limit=1
|
||||||
# )
|
)
|
||||||
# self.assertTrue(this)
|
self.assertTrue(this)
|
||||||
# # Only recently exectued areas should have been created by test user:
|
# Only recently exectued areas should have been created by test user:
|
||||||
# self.assertEqual(this.create_uid, self.mrp_manager)
|
self.assertEqual(this.create_uid, self.mrp_manager)
|
||||||
# prev = self.mrp_inventory_obj.search(
|
prev = self.mrp_inventory_obj.search(
|
||||||
# [("mrp_area_id", "!=", self.secondary_area.id)], limit=1
|
[("mrp_area_id", "!=", self.secondary_area.id)], limit=1
|
||||||
# )
|
)
|
||||||
# self.assertNotEqual(this.create_uid, prev.create_uid)
|
self.assertNotEqual(this.create_uid, prev.create_uid)
|
||||||
|
|
||||||
def test_11_special_scenario_1(self):
|
def test_11_special_scenario_1(self):
|
||||||
"""When grouping demand supply and demand are in the same day but
|
"""When grouping demand supply and demand are in the same day but
|
||||||
|
|||||||
@@ -735,6 +735,7 @@ class MultiLevelMrp(models.TransientModel):
|
|||||||
self._mrp_calculation(mrp_lowest_llc, self.mrp_area_ids)
|
self._mrp_calculation(mrp_lowest_llc, self.mrp_area_ids)
|
||||||
self._mrp_final_process(self.mrp_area_ids)
|
self._mrp_final_process(self.mrp_area_ids)
|
||||||
# Open MRP inventory screen to show result if manually run:
|
# Open MRP inventory screen to show result if manually run:
|
||||||
|
# Done as sudo to allow non-admin users to read the action.
|
||||||
action = self.env.ref("mrp_multi_level.mrp_inventory_action")
|
action = self.env.ref("mrp_multi_level.mrp_inventory_action")
|
||||||
result = action.read()[0]
|
result = action.sudo().read()[0]
|
||||||
return result
|
return result
|
||||||
|
|||||||
Reference in New Issue
Block a user