Browse Source

Mise à 0 du solde quand pas de vente

environments/production/deployments/16
Hugo LEVY-FALK 7 years ago
parent
commit
e11ad583cb
  1. 2
      comet/account/models.py

2
comet/account/models.py

@ -19,7 +19,7 @@ class Account(models.Model):
"""Adjust the ballance according to the sales, """Adjust the ballance according to the sales,
without saving the model.""" without saving the model."""
self.balance = Sale.objects.filter(account=self)\ self.balance = Sale.objects.filter(account=self)\
.aggregate(models.Sum('price'))['price__sum'] .aggregate(models.Sum('price'))['price__sum'] or 0
class Sale(models.Model): class Sale(models.Model):

Loading…
Cancel
Save