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
|
return self.quantity - self.quantity_fulfilled
|
||||||
|
|
||||||
def minus_stock(self):
|
def minus_stock(self):
|
||||||
if self.variant.track_inventory:
|
if self.variant and self.variant.track_inventory:
|
||||||
self.variant.stock -= self.quantity
|
self.variant.stock -= self.quantity
|
||||||
self.variant.save()
|
self.variant.save()
|
||||||
|
|
||||||
def add_stock(self):
|
def add_stock(self):
|
||||||
if self.variant.track_inventory:
|
if self.variant and self.variant.track_inventory:
|
||||||
self.variant.stock += self.quantity
|
self.variant.stock += self.quantity
|
||||||
self.variant.save()
|
self.variant.save()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user