diff --git a/stock.py b/stock.py index b4ae0d884a..b461142a04 100644 --- a/stock.py +++ b/stock.py @@ -165,8 +165,8 @@ class Move(metaclass=PoolMeta): and self.origin.quantity < 0 and self.from_location.type != 'storage' and self.to_location.type == 'storage' - and isinstance(self.origin.origin, Sale)): - sale = self.origin.origin + and isinstance(self.origin.sale.origin, Sale)): + sale = self.origin.sale.origin cost = Decimal(0) qty = Decimal(0) for move in sale.moves: