diff --git a/mayan/apps/cabinets/forms.py b/mayan/apps/cabinets/forms.py index 82626055c9..e88c0d8973 100644 --- a/mayan/apps/cabinets/forms.py +++ b/mayan/apps/cabinets/forms.py @@ -6,7 +6,9 @@ from mayan.apps.common.forms import FilteredSelectionForm class CabinetListForm(FilteredSelectionForm): - _field_name = 'cabinets' - _label = _('Cabinets') - _widget_attributes = {'class': 'select2'} - _allow_multiple = True + class Meta: + allow_multiple = True + field_name = 'cabinets' + label = _('Cabinets') + required = False + widget_attributes = {'class': 'select2'} diff --git a/mayan/apps/cabinets/wizard_steps.py b/mayan/apps/cabinets/wizard_steps.py index 5f409480b4..4454efdcae 100644 --- a/mayan/apps/cabinets/wizard_steps.py +++ b/mayan/apps/cabinets/wizard_steps.py @@ -9,6 +9,7 @@ from django.utils.translation import ugettext_lazy as _ from mayan.apps.sources.wizards import WizardStep from .forms import CabinetListForm +from .models import Cabinet from .permissions import permission_cabinet_add_document @@ -41,6 +42,7 @@ class WizardStepCabinets(WizardStep): return { 'help_text': _('Cabinets to which the document will be added.'), 'permission': permission_cabinet_add_document, + 'queryset': Cabinet.objects.all(), 'user': wizard.request.user }