Files
stock-logistics-warehouse/stock_warehouse_relationship/models/stock_quant_package.py
Pierre Verkest c73621f2c0 [ADD] stock_warehouse_relationship: add warehouse id on various model
useful for other modules such as stokc_multi_warehouse_security
2024-01-29 14:42:40 +01:00

15 lines
437 B
Python

# Copyright (C) 2019 Akretion
# Copyright 2022 Foodles (http://www.foodles.co).
# @author Pierre Verkest <pierreverkest84@gmail.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class StockQuantPackage(models.Model):
_inherit = "stock.quant.package"
warehouse_id = fields.Many2one(
"stock.warehouse", related="location_id.warehouse_id", store=True, index=True
)