diff --git a/core/apps/orders/models/party.py b/core/apps/orders/models/party.py index 70f967a..dfc9be8 100644 --- a/core/apps/orders/models/party.py +++ b/core/apps/orders/models/party.py @@ -70,15 +70,9 @@ class Party(BaseModel): elif self.status == 'PURCHASED': self.process = 75 elif self.status == 'PARTY_IS_MADE': - self.process = 100 - # if not self.payment_percentage: - # 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.0 - # self.status == 'PURCHASED' + for order in self.orders.all(): + percentage += order.completion_percentage + self.process = percentage return super().save(*args, **kwargs) class Meta: