club: ClubSellingView way faster and with multiple selections everywhere

This commit is contained in:
2019-11-27 20:37:28 +01:00
parent af48553e35
commit 7d40e11144
2 changed files with 25 additions and 17 deletions

View File

@ -170,21 +170,21 @@ class SellingsForm(forms.Form):
required=False,
widget=SelectDateTime,
)
counter = forms.ModelChoiceField(
counters = forms.ModelMultipleChoiceField(
Counter.objects.order_by("name").all(), label=_("Counter"), required=False
)
def __init__(self, club, *args, **kwargs):
super(SellingsForm, self).__init__(*args, **kwargs)
self.fields["product"] = forms.ModelChoiceField(
self.fields["products"] = forms.ModelMultipleChoiceField(
club.products.order_by("name").filter(archived=False).all(),
label=_("Product"),
label=_("Products"),
required=False,
)
self.fields["archived_product"] = forms.ModelChoiceField(
self.fields["archived_products"] = forms.ModelMultipleChoiceField(
club.products.order_by("name").filter(archived=True).all(),
label=_("Archived product"),
label=_("Archived products"),
required=False,
)