Check if move has shipment before assigning inventory moves

The moves on sale line do not always have a shipment, for example for drop
shipment.

issue11217
review427641003
This commit is contained in:
Cédric Krier
2022-09-08 12:56:39 +02:00
parent 37996fe7fb
commit 713660357e
+4 -3
View File
@@ -220,9 +220,10 @@ class Line(metaclass=PoolMeta):
moves = set()
for move in self.moves:
for inv_move in move.shipment.inventory_moves:
if inv_move.product.id == self.product.id:
moves.add(inv_move)
if move.shipment:
for inv_move in move.shipment.inventory_moves:
if inv_move.product.id == self.product.id:
moves.add(inv_move)
to_write = []
to_assign = []
for move in moves: