aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--servo/forms/devices.py16
-rwxr-xr-xservo/templates/customers/view.html2
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 %}