Test origin before using it in wait
The origin is not required on moves of drop shipment. issue5937 review25711002
This commit is contained in:
1 parent
c7c9772293
commit
e237a7b6ef
1 file changed
+3
-1
@@ -396,7 +396,7 @@ class ShipmentDrop(Workflow, ModelSQL, ModelView):
|
||||
|
||||
requests = []
|
||||
for sub_lines in grouped_slice([m.origin.id for s in shipments
|
||||
for m in s.supplier_moves]):
|
||||
for m in s.supplier_moves if m.origin]):
|
||||
requests += PurchaseRequest.search([
|
||||
('purchase_line', 'in', list(sub_lines)),
|
||||
])
|
||||
@@ -409,6 +409,8 @@ class ShipmentDrop(Workflow, ModelSQL, ModelView):
|
||||
to_save = []
|
||||
for shipment in shipments:
|
||||
for move in shipment.supplier_moves:
|
||||
if not move.origin:
|
||||
continue
|
||||
sale_line = request2sline[pline2request[move.origin]]
|
||||
for move in sale_line.moves:
|
||||
if (move.state not in ('cancel', 'done')
|
||||
|
||||
Reference in new issue
Block a user