Ignore storage types constraints on quants in cells

When the putaway selects a tray and a cell according to the storage
type, we still want the user to be able to override the selection by
scanning another tray type.
This commit is contained in:
Guewen Baconnier
2020-07-03 10:11:53 +02:00
parent e01d754e93
commit c16a5e308b
2 changed files with 19 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
from . import stock_location
from . import stock_location_tray_type
from . import stock_quant
from . import vertical_lift_operation_put

View File

@@ -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()