orders: fixed old bugs
This commit is contained in:
@@ -42,8 +42,8 @@ class Party(BaseModel):
|
||||
confirmation = models.CharField(max_length=20, choices=CONFIRMATION, default='EXPECTED')
|
||||
currency = models.CharField(choices=[('usd', 'usd'), ('uzs', 'uzs')], max_length=3, default='uzs')
|
||||
# percentages
|
||||
payment_percentage = models.FloatField(null=True, blank=True)
|
||||
process = models.FloatField(null=True, blank=True)
|
||||
payment_percentage = models.FloatField(default=0.0)
|
||||
process = models.FloatField(default=0.0)
|
||||
|
||||
comment = models.TextField(null=True, blank=True)
|
||||
audit = models.CharField(
|
||||
@@ -70,10 +70,7 @@ class Party(BaseModel):
|
||||
elif self.status == 'PURCHASED':
|
||||
self.process = 75
|
||||
elif self.status == 'PARTY_IS_MADE':
|
||||
percentage = 0.0
|
||||
for order in self.orders.all():
|
||||
percentage += order.completion_percentage
|
||||
self.process = percentage
|
||||
self.process == 100
|
||||
return super().save(*args, **kwargs)
|
||||
|
||||
class Meta:
|
||||
|
||||
Reference in New Issue
Block a user