Skip to content

Commit

Permalink
[FIX] stock_helper: fix tests based on modules installed
Browse files Browse the repository at this point in the history
Since this change in v17
odoo/odoo@439ca89
_get_rule fallbacks to location's warehouse to check for routes.
This makes that the receipt route is found by _get_source_location_from_route.
However, this is the case only with `stock` module installed, because
as soon as `mrp` or `purchase` is installed that first step of the receipt
route get removed in favor of manufacture or purchase routes. See
odoo/odoo@d25d320
  • Loading branch information
LoisRForgeFlow committed Dec 12, 2024
1 parent c7400b3 commit 3e68aa5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion stock_helper/tests/test_location_source_from_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,16 @@ def test_get_source_location_from_route(self):
source_location = location._get_source_location_from_route(
route, "make_to_stock"
)
self.assertEqual(source_location, self.supplier_loc)
# Since this change in v17
# https://github.com/odoo/odoo/commit/439ca89a68fe957adbe0f7a6147047593155aa9f
# _get_rule fallbacks to location's warehouse to check for routes.
# This makes that the receipt route is found by _get_source_location_from_route.
# However, this is the case only with `stock` module installed, because
# as soon as `mrp` or `purchase` is installed that first step of the receipt
# route get removed in favor of manufacture or purchase routes. See
# https://github.com/odoo/odoo/commit/d25d320e0e870980971de945719f7b7d5deadd3c
if hasattr(self.wh, "manufacture_to_resupply") or hasattr(self.wh, "buy_to_resupply"):
expected_location = False
else: # only `stock` installed.
expected_location = self.supplier_loc
self.assertEqual(source_location, expected_location)

0 comments on commit 3e68aa5

Please sign in to comment.