mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
The first method is: StockLocation.is_sublocation_of() This method is currently used in: * wms/stock_dynamic_routing * wms/shopfloor * wms/stock_move_source_relocate * stock-logistics-warehouse/stock_reserve_rule * ddmrp/ddmrp The goal will be to use this module as dependency instead of reimplementing the method in each. Other methods should follow in "stock_helper". Note: I opened https://github.com/odoo/odoo/pull/53866 to propose a generic version of this method, expecting odoo's opinion, but got no answer.
20 lines
717 B
Python
20 lines
717 B
Python
# Copyright 2020-2021 Camptocamp SA
|
|
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
|
|
|
from odoo.tests import SavepointCase
|
|
|
|
|
|
class StockHelperCommonCase(SavepointCase):
|
|
@classmethod
|
|
def setUpClass(cls):
|
|
super().setUpClass()
|
|
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
|
|
|
|
cls.wh = cls.env.ref("stock.warehouse0")
|
|
|
|
cls.customer_loc = cls.env.ref("stock.stock_location_customers")
|
|
cls.supplier_loc = cls.env.ref("stock.stock_location_suppliers")
|
|
cls.stock_loc = cls.wh.lot_stock_id
|
|
cls.shelf1_loc = cls.env.ref("stock.stock_location_components")
|
|
cls.shelf2_loc = cls.env.ref("stock.stock_location_14")
|