From 3ade6287454800f7d70f102a02dec9e36c5fd8ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 16 Oct 2025 01:12:51 +0200 Subject: [PATCH] Add destination warehouse to internal shipment --- modules/stock/shipment.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/stock/shipment.py b/modules/stock/shipment.py index be4d0f265e..891d819c47 100644 --- a/modules/stock/shipment.py +++ b/modules/stock/shipment.py @@ -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'])