Always show coupon per party

The number of use can not be used to inactivate such coupon as new party can
always be created.

issue8869
review266451002
This commit is contained in:
Cédric Krier committed 2019-12-05 21:28:52 +01:00
1 parent 4463fc30eb
commit db23e2f949
1 file changed
+2 -1
+2 -1
View File
@@ -157,7 +157,8 @@ class PromotionCouponNumber(DeactivableMixin, ModelSQL, ModelView):
else_=Literal(True))
else:
active = Case(
((coupon.number_of_use > 0),
((coupon.number_of_use > 0)
& ~Coalesce(coupon.per_party, False),
Count(sale_number.sale) < coupon.number_of_use),
else_=Literal(True))