FIX sale-use-original-cost-price when origin is null

#044440
This commit is contained in:
Raimon Esteve 2021-04-29 13:26:43 +02:00
parent 781af48af6
commit 20e37e59c8

View file

@ -48,7 +48,7 @@ index 8d34c30..28f1116 100644
+ and self.origin.quantity < 0
+ and self.from_location.type != 'storage'
+ and self.to_location.type == 'storage'
+ and isinstance(self.origin.origin, Sale)):
+ and self.origin.origin and isinstance(self.origin.origin, Sale)):
+ sale = self.origin.origin
+ cost = Decimal(0)
+ qty = Decimal(0)