From cbe541d382758162da57ef009d8fc42434cca968 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Fri, 12 Jan 2018 16:03:48 +0100 Subject: [PATCH] =?UTF-8?q?Fix,=20le=20solde=20est=20calcul=C3=A9=20pour?= =?UTF-8?q?=20des=20factures=20valides?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/users/models.py b/users/models.py index 1852c687..148142a4 100644 --- a/users/models.py +++ b/users/models.py @@ -413,7 +413,8 @@ class User(FieldPermissionModelMixin, AbstractBaseUser, PermissionsMixin): somme_debit = Vente.objects.filter( facture__in=Facture.objects.filter( user=self, - paiement__in=solde_objects + paiement__in=solde_objects, + valid=True ) ).aggregate( total=models.Sum( @@ -422,7 +423,7 @@ class User(FieldPermissionModelMixin, AbstractBaseUser, PermissionsMixin): ) )['total'] or 0 somme_credit = Vente.objects.filter( - facture__in=Facture.objects.filter(user=self), + facture__in=Facture.objects.filter(user=self, valid=True), name="solde" ).aggregate( total=models.Sum(