From 4c692a42e0b76af7d3c443d52663a805d8969f35 Mon Sep 17 00:00:00 2001 From: Hugo Levy-Falk Date: Tue, 1 Sep 2020 21:13:05 +0100 Subject: [PATCH] Fix availability of non cotisation articles in facture creation. --- cotisations/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cotisations/models.py b/cotisations/models.py index 00978275..dc415624 100644 --- a/cotisations/models.py +++ b/cotisations/models.py @@ -778,7 +778,7 @@ class Article(RevMixin, AclMixin, models.Model): Args: user: The user requesting articles. - target_user: The user to sell articles + target_user: The user to sell articles to """ if target_user is None: objects_pool = cls.objects.all() @@ -790,7 +790,9 @@ class Article(RevMixin, AclMixin, models.Model): ) if target_user is not None and not target_user.is_adherent(): objects_pool = objects_pool.filter( - Q(type_cotisation="All") | Q(type_cotisation="Adhesion") + Q(type_cotisation="All") + | Q(type_cotisation="Adhesion") + | Q(type_cotisation__isnull=True) ) if user.has_perm("cotisations.buy_every_article"): return objects_pool