Skip to content

Commit

Permalink
Merge PR #2220 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by LoisRForgeFlow
  • Loading branch information
OCA-git-bot committed Dec 13, 2024
2 parents c7400b3 + 6cf3f38 commit 69453ca
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 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,18 @@ 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 69453ca

Please sign in to comment.