mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-25 22:22:26 +00:00
Fix availability of non cotisation articles in facture creation.
This commit is contained in:
parent
0051099267
commit
4c692a42e0
1 changed files with 4 additions and 2 deletions
|
@ -778,7 +778,7 @@ class Article(RevMixin, AclMixin, models.Model):
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
user: The user requesting articles.
|
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:
|
if target_user is None:
|
||||||
objects_pool = cls.objects.all()
|
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():
|
if target_user is not None and not target_user.is_adherent():
|
||||||
objects_pool = objects_pool.filter(
|
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"):
|
if user.has_perm("cotisations.buy_every_article"):
|
||||||
return objects_pool
|
return objects_pool
|
||||||
|
|
Loading…
Reference in a new issue