From 377cc531f6df67f39ad3132631de2deb1d0b7c66 Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Tue, 7 Oct 2025 16:32:56 +0500 Subject: [PATCH] change type --- core/apps/orders/models/party.py | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/core/apps/orders/models/party.py b/core/apps/orders/models/party.py index 9e8f4a6..c3073a6 100644 --- a/core/apps/orders/models/party.py +++ b/core/apps/orders/models/party.py @@ -59,23 +59,23 @@ class Party(BaseModel): def __str__(self): return f'P - {self.number}' - def save(self, *args, **kwargs): - if self.status in ['NEW', 'CANCELLED', 'DRAFT']: - self.process = 0 - elif self.status == 'EXPECTED': - self.process = 25 - elif self.status == 'PROCESS': - self.process = 50 - elif self.status == 'PURCHASED': - self.process = 75 - elif self.status == 'PARTY_IS_MADE': - self.process = 100 - if hasattr(self, 'party_amount') and self.party_amount.paid_amount > 0 and self.party_amount.payment_amount > 0: - self.payment_percentage = (self.party_amount.paid_amount / self.party_amount.payment_amount) * 100 - self.party_amount.save() - else: - self.payment_percentage = 100 - return super().save(*args, **kwargs) + # def save(self, *args, **kwargs): + # if self.status in ['NEW', 'CANCELLED', 'DRAFT']: + # self.process = 0 + # elif self.status == 'EXPECTED': + # self.process = 25 + # elif self.status == 'PROCESS': + # self.process = 50 + # elif self.status == 'PURCHASED': + # self.process = 75 + # elif self.status == 'PARTY_IS_MADE': + # self.process = 100 + # if hasattr(self, 'party_amount') and self.party_amount.paid_amount > 0 and self.party_amount.payment_amount > 0: + # self.payment_percentage = (self.party_amount.paid_amount / self.party_amount.payment_amount) * 100 + # self.party_amount.save() + # else: + # self.payment_percentage = 100 + # return super().save(*args, **kwargs) class Meta: verbose_name = 'Partiya'