details: https://code.tryton.org/tryton/commit/e2aa24e0782f
branch: default
user: Cédric Krier <[email protected]>
date: Thu Oct 16 01:12:51 2025 +0200
description:
Add destination warehouse to internal shipment
diffstat:
modules/stock/shipment.py | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diffs (29 lines):
diff -r 6007ca116c1e -r e2aa24e0782f modules/stock/shipment.py
--- a/modules/stock/shipment.py Sat Nov 22 10:44:35 2025 +0100
+++ b/modules/stock/shipment.py Thu Oct 16 01:12:51 2025 +0200
@@ -2307,6 +2307,14 @@
'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 @@
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'])