From fd72e52de6700b954c284658d3577e8a7dffcc71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 4 Sep 2023 16:47:49 +0200 Subject: [PATCH] Do not try to duplicate moves for transit if internal shipment has no move Closes #12541 (grafted from 812f190f0f95914a8a68332584e54405a7e68347) --HG-- branch : 6.0 --- modules/stock/shipment.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/stock/shipment.py b/modules/stock/shipment.py index b542576386..a929dec67e 100644 --- a/modules/stock/shipment.py +++ b/modules/stock/shipment.py @@ -2494,6 +2494,8 @@ class ShipmentInternal(ShipmentAssignMixin, Workflow, ModelSQL, ModelView): if m.state != 'done' and m.from_location != shipment.transit_location and m.to_location != shipment.transit_location] + if not moves: + continue Move.copy(moves, default={ 'to_location': shipment.transit_location.id, 'planned_date': shipment.planned_start_date,