From e11ad583cb0990c062e6364a9de6070a84bbf860 Mon Sep 17 00:00:00 2001 From: Hugo LEVY-FALK Date: Tue, 5 Feb 2019 19:43:17 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=200=20du=20solde=20quand=20pas=20?= =?UTF-8?q?de=20vente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comet/account/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comet/account/models.py b/comet/account/models.py index d042805..3ef2878 100644 --- a/comet/account/models.py +++ b/comet/account/models.py @@ -19,7 +19,7 @@ class Account(models.Model): """Adjust the ballance according to the sales, without saving the model.""" 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):