Files
stock-logistics-warehouse/stock_vertical_lift/models/stock_quant.py
Guewen Baconnier 4d3ce20810 Split the shuttle operations in different models/views
Namely, the pick/put/inventory operations are now split in
different models.

Pick and Put share a model and customize their behavior, which is pretty
similar. The inventory operation will have a different view and
different workflow.

This changes will ease a lot the customization of the different
workflows and views.
2021-09-16 20:17:33 +07:00

24 lines
787 B
Python

# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
class StockQuant(models.Model):
_inherit = 'stock.quant'
def _update_available_quantity(self, *args, **kwargs):
result = super()._update_available_quantity(*args, **kwargs)
# We cannot have fields to depends on to invalidate this computed
# fields on vertical.lift.operation.* models. But we know that when the
# quantity of quant changes, we can invalidate the field
models = (
"vertical.lift.operation.pick",
"vertical.lift.operation.put",
)
for model in models:
self.env[model].invalidate_cache(
["tray_qty"]
)
return result