Merge branch 'main' into storefront-nuxt
This commit is contained in:
commit
6b0d1ad1dc
1 changed files with 4 additions and 0 deletions
|
|
@ -1937,8 +1937,12 @@ class OrderProduct(ExportModelOperationsMixin("order_product"), NiceModel):
|
||||||
]
|
]
|
||||||
|
|
||||||
def return_balance_back(self):
|
def return_balance_back(self):
|
||||||
|
if self.status == "RETURNED":
|
||||||
|
return
|
||||||
self.status = "RETURNED"
|
self.status = "RETURNED"
|
||||||
self.save()
|
self.save()
|
||||||
|
if not self.order.user:
|
||||||
|
raise NotImplementedError
|
||||||
self.order.user.payments_balance.amount += self.buy_price
|
self.order.user.payments_balance.amount += self.buy_price
|
||||||
self.order.user.payments_balance.save()
|
self.order.user.payments_balance.save()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue