Files
stock-logistics-warehouse/stock_helper/tests/test_location_source_from_route.py
Michael Tietz 1c85d1564e [IMP] stock_helper: add location._get_source_location_from_route
returns the next source location of a location by the given route and procure_method
2023-04-17 15:41:56 +02:00

41 lines
1.4 KiB
Python

# Copyright 2022 Michael Tietz (MT Software) <mtietz@mt-software.de>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from .common import StockHelperCommonCase
class TestStockLocationSoruceFromRoute(StockHelperCommonCase):
def test_get_source_location_from_route(self):
self.wh.delivery_steps = "pick_pack_ship"
route = self.wh.delivery_route_id
location = self.env.ref("stock.stock_location_customers")
source_location = location._get_source_location_from_route(
route, "make_to_stock"
)
self.assertEqual(source_location, self.wh.lot_stock_id)
source_location = location._get_source_location_from_route(
route, "make_to_order"
)
self.assertEqual(source_location, self.wh.wh_output_stock_loc_id)
location = source_location
source_location = location._get_source_location_from_route(
route, "make_to_order"
)
self.assertEqual(source_location, self.wh.wh_pack_stock_loc_id)
location = source_location
source_location = location._get_source_location_from_route(
route, "make_to_stock"
)
self.assertEqual(source_location, self.wh.lot_stock_id)
location = source_location
source_location = location._get_source_location_from_route(
route, "make_to_stock"
)
self.assertFalse(source_location)