update order list serializer add get order view and its permission

This commit is contained in:
Parsa Nazer
2025-03-17 16:15:38 +03:30
parent b29e0a4958
commit f9a339b039
8 changed files with 124 additions and 27 deletions
+14 -14
View File
@@ -59,7 +59,7 @@ class OrderModel(models.Model):
bank_records = models.ManyToManyField(Bank, max_length=100, verbose_name='رکورد بانکی', null=True, blank=True)
def __str__(self):
return f'سفارش: {self.id}'
return f'سفارش: {self.id + 1000}'
class Meta:
verbose_name = 'سفارش'
@@ -80,27 +80,27 @@ class OrderModel(models.Model):
def discount(self):
# total_with_item_discount = sum(item.total_with_discount() for item in self.items.all())
# discount_percent = self.discount_code.percent
# return total_with_item_discount * ((100 - discount_percent) / 100)
pass
# def discount(self):
# # total_with_item_discount = sum(item.total_with_discount() for item in self.items.all())
# # discount_percent = self.discount_code.percent
# # return total_with_item_discount * ((100 - discount_percent) / 100)
# pass
def tax(self):
return self.total_without_tax() * 0.2
# def tax(self):
# return self.total_without_tax() * 0.2
def total(self):
pass
# def total(self):
# pass
# return self.total_with_discount() + self.tax()
def final_price(self):
pass
# def final_price(self):
# pass
def submit_cart(self):
pass
# def submit_cart(self):
# pass