This commit is contained in:
behruz-dev
2025-11-12 13:54:21 +05:00
parent 1878e8696e
commit 32ec86b3b4
4 changed files with 97 additions and 93 deletions

View File

@@ -76,7 +76,8 @@ class Party(BaseModel):
for order in self.orders.all():
count += 1
percentage += order.completion_percentage
self.process = percentage / count
if percentage > 0 and count > 0:
self.process = percentage / count
return super().save(*args, **kwargs)