Fix when canceling a subscription order on checking stock
This commit is contained in:
parent
00d57f4bab
commit
2ad1b56b28
@ -490,12 +490,12 @@ class OrderLine(models.Model):
|
||||
return self.quantity - self.quantity_fulfilled
|
||||
|
||||
def minus_stock(self):
|
||||
if self.variant.track_inventory:
|
||||
if self.variant and self.variant.track_inventory:
|
||||
self.variant.stock -= self.quantity
|
||||
self.variant.save()
|
||||
|
||||
def add_stock(self):
|
||||
if self.variant.track_inventory:
|
||||
if self.variant and self.variant.track_inventory:
|
||||
self.variant.stock += self.quantity
|
||||
self.variant.save()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user