Control when set transit location, to not try to copy a None moves.

This commit is contained in:
Bernat Brunet 2022-11-30 11:46:31 +01:00
parent 707a282cad
commit e23b4412aa
2 changed files with 15 additions and 0 deletions

2
series
View File

@ -71,3 +71,5 @@ allow_none_list_price.diff # [sale_price_list] allow set none as price list in a
issue11913.diff # [trytond] Too fast worker loop
remove_left_right_project_work.diff # [project] Remove parent left and parent right for the project.work module.
stock_shipment.diff # [stock] No try to copy None moves when set transit location

13
stock_shipment.diff Normal file
View File

@ -0,0 +1,13 @@
diff --git a/shipment.py b/shipment.py
index 9067c31..6c64390 100644
--- a/trytond/trytond/modules/stock/shipment.py
+++ b/trytond/trytond/modules/stock/shipment.py
@@ -2476,6 +2476,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,