diff options
author | Filipp Lepalaan <filipp@mac.com> | 2015-12-12 23:56:41 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2015-12-12 23:56:41 +0200 |
commit | 8b336df1628fe16c5c068002e543e22a51f75da5 (patch) | |
tree | dce68019dd7ad0f2b82f20b959506e96788f2448 /servo | |
parent | b6fe7d57744b6144869c12b9d3435099037d3498 (diff) | |
download | Servo-8b336df1628fe16c5c068002e543e22a51f75da5.tar.gz Servo-8b336df1628fe16c5c068002e543e22a51f75da5.tar.bz2 Servo-8b336df1628fe16c5c068002e543e22a51f75da5.zip |
Move customer selection to customer view
Diffstat (limited to 'servo')
-rw-r--r-- | servo/forms/devices.py | 16 | ||||
-rwxr-xr-x | servo/templates/customers/view.html | 2 |
2 files changed, 13 insertions, 5 deletions
diff --git a/servo/forms/devices.py b/servo/forms/devices.py index 47838b1..8a451cf 100644 --- a/servo/forms/devices.py +++ b/servo/forms/devices.py @@ -57,12 +57,18 @@ class DeviceForm(forms.ModelForm): class DeviceUploadForm(forms.Form): - datafile = forms.FileField() - customer = forms.ModelChoiceField( - queryset=Customer.objects.all(), - required=False + datafile = forms.FileField( + help_text=_('Device data in Excel format (.xls or .xlsx)') + ) + customer = forms.IntegerField( + required=False, + widget=forms.HiddenInput, + ) + do_warranty_check = forms.BooleanField( + required=False, + initial=True, + help_text=_('Perform warranty check on uploaded serial numbers') ) - do_warranty_check = forms.BooleanField(required=False, initial=True) class DiagnosticsForm(forms.Form): diff --git a/servo/templates/customers/view.html b/servo/templates/customers/view.html index 6e28643..98fbfc9 100755 --- a/servo/templates/customers/view.html +++ b/servo/templates/customers/view.html @@ -68,9 +68,11 @@ {% if perms.servo.change_customer %} <li><a href="{% url 'customers-move_customer' pk=customer.pk %}" data-modal="#modal">{% trans "Move Customer" %}</a></li> <li><a href="{% url 'customers-merge_customer' pk=customer.pk %}" data-modal="#modal">{% trans "Merge Customer" %}</a></li> + <li><a href="{% url 'devices-upload_devices' %}?c={{ customer.pk|safe }}" data-modal="#modal">{% trans "Upload Devices" %}</a></li> {% else %} <li><a href="#" class="disabled">{% trans "Move Customer" %}</a></li> <li><a href="#" class="disabled">{% trans "Merge Customer" %}</a></li> + <li><a href="#" class="disabled">{% trans "Upload Devices" %}</a></li> {% endif %} <li class="divider"></li> {% if perms.servo.delete_customer %} |