Allow to hide a product unless a specific quota is sold out (#1351)

* Allow to hide a product unless a specific quota is sold out

* Fix required property

* Add API property and copy between events
This commit is contained in:
Raphael Michel
2019-07-25 16:14:24 +02:00
committed by GitHub
parent 2dd75ea252
commit e83e8cdcc0
16 changed files with 250 additions and 8 deletions

View File

@@ -254,6 +254,11 @@ class AddOnsForm(forms.Form):
self.vars_cache = {}
for i in items:
if i.hidden_if_available:
q = i.hidden_if_available.availability(_cache=quota_cache)
if q[0] == Quota.AVAILABILITY_OK:
continue
if i.has_variations:
choices = [('', _('no selection'), '')]
for v in i.available_variations: