aboutsummaryrefslogtreecommitdiffstats
path: root/servo/forms
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-12-11 11:42:51 +0200
committerFilipp Lepalaan <filipp@mac.com>2015-12-11 11:42:51 +0200
commitc19241dc3812c92b150376c3c8108c3359aaf488 (patch)
tree5754cec5ff58d1b398ef06427cba0f451d8ef77d /servo/forms
parentede4b92846696806eeff5324da7b31196aee108f (diff)
downloadServo-c19241dc3812c92b150376c3c8108c3359aaf488.tar.gz
Servo-c19241dc3812c92b150376c3c8108c3359aaf488.tar.bz2
Servo-c19241dc3812c92b150376c3c8108c3359aaf488.zip
Added upload prices function
Diffstat (limited to 'servo/forms')
-rw-r--r--servo/forms/product.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/servo/forms/product.py b/servo/forms/product.py
index 61969f1..7e0f52e 100644
--- a/servo/forms/product.py
+++ b/servo/forms/product.py
@@ -12,14 +12,8 @@ from servo.forms.base import BaseModelForm, DatepickerInput, TextInput
class ProductSearchForm(forms.Form):
- title = forms.CharField(
- required=False,
- label=_('Name contains')
- )
- code = forms.CharField(
- required=False,
- label=_('Code contains')
- )
+ title = forms.CharField(required=False, label=_('Name contains'))
+ code = forms.CharField(required=False, label=_('Code contains'))
description = forms.CharField(
required=False,
label=_('Description contains')
@@ -213,13 +207,23 @@ class ReserveProductForm(forms.Form):
"""
Form for reserving products for a given SO
"""
- inventory = forms.ModelChoiceField(
- queryset=Inventory.objects.none(),
- label=_('Inventory')
- )
+ inventory = forms.ModelChoiceField(queryset=Inventory.objects.none(),
+ label=_('Inventory'))
def __init__(self, order, *args, **kwargs):
super(ReserveProductForm, self).__init__(*args, **kwargs)
inventory = Inventory.objects.filter(location=order.location,
product__in=order.products.all())
self.fields['inventory'].queryset = inventory
+
+
+class UploadPricesForm(forms.Form):
+ datafile = forms.FileField(label=_('Price data in Excel format (.xlsx)'),
+ help_text=_('This will also update products with fixed prices'))
+ create_new = forms.BooleanField(label=_('Create new products'),
+ required=False,
+ initial=True,
+ help_text=_('Create products if not found'))
+ set_fixed = forms.BooleanField(label=_('Set fixed price'),
+ required=False,
+ help_text=_('Mark all uploaded products as having a fixed price'))