diff --git a/sale.py b/sale.py index 4f27656e3e..4ffe8fb9ad 100644 --- a/sale.py +++ b/sale.py @@ -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: