diff --git a/stock_vertical_lift_storage_type/models/__init__.py b/stock_vertical_lift_storage_type/models/__init__.py index 029c1ede2..cb2169a09 100644 --- a/stock_vertical_lift_storage_type/models/__init__.py +++ b/stock_vertical_lift_storage_type/models/__init__.py @@ -1,3 +1,4 @@ from . import stock_location from . import stock_location_tray_type +from . import stock_quant from . import vertical_lift_operation_put diff --git a/stock_vertical_lift_storage_type/models/stock_quant.py b/stock_vertical_lift_storage_type/models/stock_quant.py new file mode 100644 index 000000000..90994ee81 --- /dev/null +++ b/stock_vertical_lift_storage_type/models/stock_quant.py @@ -0,0 +1,18 @@ +# Copyright 2020 Camptocamp SA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) +from odoo import models + + +class StockQuant(models.Model): + + _inherit = "stock.quant" + + def _check_storage_type(self): + # disable the checks when placing goods in vertical lift cells: + # we still want to benefit of the storage type rules to select + # a destination, but we want to allow selecting a different tray + # type + self = self.filtered( + lambda quant: quant.location_id.vertical_lift_kind != "cell" + ) + super()._check_storage_type()