Add destination warehouse to internal shipment

This commit is contained in:
Cédric Krier
2025-10-16 01:12:51 +02:00
parent f67a5f8db9
commit 3ade628745
+12
View File
@@ -2307,6 +2307,14 @@ class ShipmentInternal(
'stock.location', "Warehouse",
help="Where the stock is sent from."),
'on_change_with_warehouse')
to_warehouse = fields.Function(
fields.Many2One(
'stock.location', "To Warehouse",
domain=[
('type', '=', 'warehouse'),
],
help="Where the stock is sent to."),
'on_change_with_to_warehouse')
moves = fields.One2Many('stock.move', 'shipment', 'Moves',
states={
'readonly': (Eval('state').in_(['cancelled', 'assigned', 'done'])
@@ -2540,6 +2548,10 @@ class ShipmentInternal(
def on_change_with_warehouse(self, name=None):
return self.from_location.warehouse if self.from_location else None
@fields.depends('to_location')
def on_change_with_to_warehouse(self, name=None):
return self.to_location.warehouse if self.to_location else None
@fields.depends(
'planned_date', 'from_location', 'to_location',
methods=['on_change_with_transit_location'])