Skip to content

Commit

Permalink
[FIX] mrp_multi_level: adapt tests to recent upstream changes.
Browse files Browse the repository at this point in the history
After odoo/odoo@1ed6dbe
we need to explicitly set routes in the propoer order becouse while
in the cache there are not yet sorted by sequence (it requires flush
to the database, which we cannot do in a test).
  • Loading branch information
LoisRForgeFlow committed Nov 28, 2024
1 parent 34d0a09 commit fbdc800
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mrp_multi_level/tests/test_mrp_multi_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,10 @@ def test_17_supply_method(self):
self.fp_4.route_ids = [(4, self.env.ref("mrp.route_warehouse0_manufacture").id)]
product_mrp_area._compute_supply_method()
self.assertEqual(product_mrp_area.supply_method, "manufacture")
# because of the issue discussed here https://github.com/odoo/odoo/pull/188846
# we need to apply routes explicitly in the proper order (by sequence)
self.fp_4.route_ids = [
(4, self.env.ref("purchase_stock.route_warehouse0_buy").id)
(6, 0, (self.env.ref("stock.route_warehouse0_mto") + self.env.ref("purchase_stock.route_warehouse0_buy") + self.env.ref("mrp.route_warehouse0_manufacture")).ids)
]
product_mrp_area._compute_supply_method()
self.assertEqual(product_mrp_area.supply_method, "buy")
Expand Down

0 comments on commit fbdc800

Please sign in to comment.