aboutsummaryrefslogtreecommitdiffstats
path: root/servo
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-11-19 22:55:58 +0200
committerFilipp Lepalaan <filipp@mac.com>2015-11-19 22:55:58 +0200
commit72111556edd4c108033e454758434df63045c0b0 (patch)
treec02fb2dbb42f4ce420e1dd93753c0ae5bf806a44 /servo
parent693697ea725b040f04dcd166f53f495ba6049eaa (diff)
downloadServo-72111556edd4c108033e454758434df63045c0b0.tar.gz
Servo-72111556edd4c108033e454758434df63045c0b0.tar.bz2
Servo-72111556edd4c108033e454758434df63045c0b0.zip
Cleanup
Diffstat (limited to 'servo')
-rw-r--r--servo/models/product.py11
-rwxr-xr-xservo/templates/products/index.html1
-rw-r--r--servo/urls/order.py13
-rw-r--r--servo/urls/products.py27
4 files changed, 36 insertions, 16 deletions
diff --git a/servo/models/product.py b/servo/models/product.py
index 768dc88..aa20cc9 100644
--- a/servo/models/product.py
+++ b/servo/models/product.py
@@ -523,6 +523,9 @@ class Product(AbstractBaseProduct):
return self.pk or Product.objects.get(code=self.code).pk
def update_photo(self):
+ """
+ Updates this product image with the GSX part image
+ """
if self.component_code and not self.photo:
try:
part = parts.Part(partNumber=self.code)
@@ -605,19 +608,19 @@ class Inventory(models.Model):
amount_minimum = models.PositiveIntegerField(
default=0,
- verbose_name=_("minimum amount")
+ verbose_name=_("Minimum amount")
)
amount_reserved = models.PositiveIntegerField(
default=0,
- verbose_name=_("reserved amount")
+ verbose_name=_("Reserved amount")
)
amount_stocked = models.IntegerField(
default=0,
- verbose_name=_("stocked amount"),
+ verbose_name=_("Stocked amount"),
)
amount_ordered = models.PositiveIntegerField(
default=0,
- verbose_name=_("ordered amount")
+ verbose_name=_("Ordered amount")
)
def move(self, new_location, amount=1):
diff --git a/servo/templates/products/index.html b/servo/templates/products/index.html
index fefcecd..1bb75db 100755
--- a/servo/templates/products/index.html
+++ b/servo/templates/products/index.html
@@ -35,6 +35,7 @@
{% endif %}
<li class="divider"></li>
<li><a href="{% url 'products-download' %}">{% trans "Download Products" %}</a></li>
+ <li class="disabled"><a href="{% url 'products-get_inventory_report' %}">{% trans "Download Inventory Report" %}</a></li>
<li><a href="{% url 'products-upload_products' %}" data-modal="#modal">{% trans "Upload Products" %}</a></li>
<li><a href="{% url 'products-upload_gsx_parts' %}" data-modal="#modal">{% trans "Upload Parts Database" %}</a></li>
</ul>
diff --git a/servo/urls/order.py b/servo/urls/order.py
index c2a49a6..96c34f8 100644
--- a/servo/urls/order.py
+++ b/servo/urls/order.py
@@ -66,10 +66,12 @@ urlpatterns = patterns(
url(r'^create/product/(?P<product_id>\d+)/$', 'create',
name="orders-create_with_product"),
- url(r'^create/note/(?P<note_id>\d+)/$', 'create', name="orders-create_with_note"),
+ url(r'^create/note/(?P<note_id>\d+)/$', 'create',
+ name="orders-create_with_note"),
url(r'^create/device/(?P<device_id>\d+)/$', 'create',
name='orders-create_with_device'),
- url(r'^create/sn/(?P<sn>\w+)?/$', 'create', name='orders-create_with_sn'),
+ url(r'^create/sn/(?P<sn>\w+)?/$', 'create',
+ name='orders-create_with_sn'),
url(r'^create/customer/(?P<customer_id>\d+)?/$', 'create',
name="orders-create_with_customer"),
@@ -85,8 +87,11 @@ urlpatterns = patterns(
name='orders-remove_product'),
url(r'^(?P<pk>\d+)/products/(?P<product_id>\d+)/add/$', 'add_product',
name="orders-add_product"),
- url(r'^(?P<pk>\d+)/devices/(?P<device>\d+)/parts/(?P<code>[\w\-/]+)/add/$', 'add_part', name="orders-add_part"),
- url(r'^(?P<pk>\d+)/devices/(?P<device>\d+)/history/$', 'history', name="orders-history"),
+ url(r'^(?P<pk>\d+)/devices/(?P<device>\d+)/parts/(?P<code>[\w\-/]+)/add/$',
+ 'add_part',
+ name="orders-add_part"),
+ url(r'^(?P<pk>\d+)/devices/(?P<device>\d+)/history/$', 'history',
+ name="orders-history"),
url(r'^(?P<pk>\d+)/products/(?P<item_id>\d+)/report/$', 'report_product',
name="orders-report_product"),
url(r'^(?P<pk>\d+)/devices/(?P<device_id>\d+)/report/$', 'report_device',
diff --git a/servo/urls/products.py b/servo/urls/products.py
index 9c60baa..c17b082 100644
--- a/servo/urls/products.py
+++ b/servo/urls/products.py
@@ -6,11 +6,19 @@ urlpatterns = patterns(
"servo.views.product",
url(r'^tags/$', "tags", name="products-tags"),
- url(r'^all/$', "list_products", {'group': 'all'}, name="products-list_products"),
- url(r'^download/$', "download_products", name="products-download"),
- url(r'^upload/$', "upload_products", name="products-upload_products"),
- url(r'^upload/parts/$', "upload_gsx_parts", name="products-upload_gsx_parts"),
- url(r'^update_price/(\d+)/$', "update_price", name="products-update_price"),
+ url(r'^all/$', "list_products", {'group': 'all'},
+ name="products-list_products"),
+ url(r'^download/$', "download_products",
+ name="products-download"),
+ url(r'^inventory_report/$', "get_inventory_report",
+ name="products-get_inventory_report"),
+
+ url(r'^upload/$', "upload_products",
+ name="products-upload_products"),
+ url(r'^upload/parts/$', "upload_gsx_parts",
+ name="products-upload_gsx_parts"),
+ url(r'^update_price/(\d+)/$', "update_price",
+ name="products-update_price"),
url(r'^all/(?P<pk>\d+)/$', "view_product", {'group': 'all'},
name="products-view_product"),
@@ -18,7 +26,8 @@ urlpatterns = patterns(
name="products-view_product"),
# Editing product categories
- url(r'^categories/create/$', "edit_category", name="products-create_category"),
+ url(r'^categories/create/$', "edit_category",
+ name="products-create_category"),
url(r'^categories/(?P<slug>[\w\-]+)/edit/$', "edit_category",
name="products-edit_category"),
url(r'^categories/(?P<slug>[\w\-]+)/delete/$', "delete_category",
@@ -28,7 +37,8 @@ urlpatterns = patterns(
# Editing products
url(r'^create/$', "edit_product", name="products-create"),
- url(r'^(?P<group>[\w\-]+)/create/$', "edit_product", name="products-create"),
+ url(r'^(?P<group>[\w\-]+)/create/$', "edit_product",
+ name="products-create"),
url(r'^(?P<group>[\w\-/]*)/(?P<pk>\d+)/edit/$', "edit_product",
name="products-edit_product"),
url(r'^(?P<group>[\w\-/]*)/(?P<pk>\d+)/delete/$', "delete_product",
@@ -49,5 +59,6 @@ urlpatterns = patterns(
"get_info",
name="products-get_info"),
- url(r'^(?P<group>[\w\-]+)/$', "list_products", name="products-list_products"),
+ url(r'^(?P<group>[\w\-]+)/$', "list_products",
+ name="products-list_products"),
)