From 3e2a5263a57ce8d88205581bd2b14798b37c85c1 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 27 Sep 2019 09:59:14 +1000 Subject: [PATCH] Add stock information for top-level stock page --- InvenTree/locale/de/LC_MESSAGES/django.po | 55 ++++++++++++++----- InvenTree/locale/en/LC_MESSAGES/django.po | 55 ++++++++++++++----- InvenTree/locale/es/LC_MESSAGES/django.po | 55 ++++++++++++++----- InvenTree/stock/templates/stock/location.html | 23 ++++++-- InvenTree/stock/views.py | 3 + InvenTree/templates/base.html | 6 -- 6 files changed, 147 insertions(+), 50 deletions(-) diff --git a/InvenTree/locale/de/LC_MESSAGES/django.po b/InvenTree/locale/de/LC_MESSAGES/django.po index c37dd0f0ae..5bc527909d 100644 --- a/InvenTree/locale/de/LC_MESSAGES/django.po +++ b/InvenTree/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-09-26 00:37+0000\n" +"POT-Creation-Date: 2019-09-26 23:58+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -149,7 +149,7 @@ msgstr "" msgid "Allocated quantity ({n}) must not exceed available quantity ({q})" msgstr "" -#: build/views.py:289 stock/views.py:831 +#: build/views.py:289 stock/views.py:834 #, python-brace-format msgid "The following serial numbers already exist: ({sn})" msgstr "" @@ -459,51 +459,80 @@ msgstr "" msgid "Serialized {n} items" msgstr "" -#: stock/views.py:396 +#: stock/templates/stock/location.html:37 +msgid "Location Details" +msgstr "" + +#: stock/templates/stock/location.html:40 +msgid "Location Path" +msgstr "" + +#: stock/templates/stock/location.html:44 +msgid "Location Description" +msgstr "" + +#: stock/templates/stock/location.html:48 +msgid "Sublocations" +msgstr "" + +#: stock/templates/stock/location.html:52 +#: stock/templates/stock/location.html:64 +msgid "Stock Items" +msgstr "" + +#: stock/templates/stock/location.html:57 +msgid "Stock Details" +msgstr "" + +#: stock/templates/stock/location.html:60 +msgid "Stock Locations" +msgstr "" + +#: stock/views.py:399 msgid "Must enter integer value" msgstr "" -#: stock/views.py:401 +#: stock/views.py:404 msgid "Quantity must be positive" msgstr "" -#: stock/views.py:408 +#: stock/views.py:411 #, python-brace-format msgid "Quantity must not exceed {x}" msgstr "" -#: stock/views.py:416 +#: stock/views.py:419 msgid "Confirm stock adjustment" msgstr "" -#: stock/views.py:484 +#: stock/views.py:487 #, python-brace-format msgid "Added stock to {n} items" msgstr "" -#: stock/views.py:499 +#: stock/views.py:502 #, python-brace-format msgid "Removed stock from {n} items" msgstr "" -#: stock/views.py:512 +#: stock/views.py:515 #, python-brace-format msgid "Counted stock for {n} items" msgstr "" -#: stock/views.py:540 +#: stock/views.py:543 msgid "No items were moved" msgstr "" -#: stock/views.py:543 +#: stock/views.py:546 #, python-brace-format msgid "Moved {n} items to {dest}" msgstr "" -#: stock/views.py:810 +#: stock/views.py:813 msgid "Invalid part selection" msgstr "" -#: stock/views.py:872 +#: stock/views.py:875 msgid "Created new stock item" msgstr "" diff --git a/InvenTree/locale/en/LC_MESSAGES/django.po b/InvenTree/locale/en/LC_MESSAGES/django.po index c37dd0f0ae..5bc527909d 100644 --- a/InvenTree/locale/en/LC_MESSAGES/django.po +++ b/InvenTree/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-09-26 00:37+0000\n" +"POT-Creation-Date: 2019-09-26 23:58+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -149,7 +149,7 @@ msgstr "" msgid "Allocated quantity ({n}) must not exceed available quantity ({q})" msgstr "" -#: build/views.py:289 stock/views.py:831 +#: build/views.py:289 stock/views.py:834 #, python-brace-format msgid "The following serial numbers already exist: ({sn})" msgstr "" @@ -459,51 +459,80 @@ msgstr "" msgid "Serialized {n} items" msgstr "" -#: stock/views.py:396 +#: stock/templates/stock/location.html:37 +msgid "Location Details" +msgstr "" + +#: stock/templates/stock/location.html:40 +msgid "Location Path" +msgstr "" + +#: stock/templates/stock/location.html:44 +msgid "Location Description" +msgstr "" + +#: stock/templates/stock/location.html:48 +msgid "Sublocations" +msgstr "" + +#: stock/templates/stock/location.html:52 +#: stock/templates/stock/location.html:64 +msgid "Stock Items" +msgstr "" + +#: stock/templates/stock/location.html:57 +msgid "Stock Details" +msgstr "" + +#: stock/templates/stock/location.html:60 +msgid "Stock Locations" +msgstr "" + +#: stock/views.py:399 msgid "Must enter integer value" msgstr "" -#: stock/views.py:401 +#: stock/views.py:404 msgid "Quantity must be positive" msgstr "" -#: stock/views.py:408 +#: stock/views.py:411 #, python-brace-format msgid "Quantity must not exceed {x}" msgstr "" -#: stock/views.py:416 +#: stock/views.py:419 msgid "Confirm stock adjustment" msgstr "" -#: stock/views.py:484 +#: stock/views.py:487 #, python-brace-format msgid "Added stock to {n} items" msgstr "" -#: stock/views.py:499 +#: stock/views.py:502 #, python-brace-format msgid "Removed stock from {n} items" msgstr "" -#: stock/views.py:512 +#: stock/views.py:515 #, python-brace-format msgid "Counted stock for {n} items" msgstr "" -#: stock/views.py:540 +#: stock/views.py:543 msgid "No items were moved" msgstr "" -#: stock/views.py:543 +#: stock/views.py:546 #, python-brace-format msgid "Moved {n} items to {dest}" msgstr "" -#: stock/views.py:810 +#: stock/views.py:813 msgid "Invalid part selection" msgstr "" -#: stock/views.py:872 +#: stock/views.py:875 msgid "Created new stock item" msgstr "" diff --git a/InvenTree/locale/es/LC_MESSAGES/django.po b/InvenTree/locale/es/LC_MESSAGES/django.po index c37dd0f0ae..5bc527909d 100644 --- a/InvenTree/locale/es/LC_MESSAGES/django.po +++ b/InvenTree/locale/es/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-09-26 00:37+0000\n" +"POT-Creation-Date: 2019-09-26 23:58+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -149,7 +149,7 @@ msgstr "" msgid "Allocated quantity ({n}) must not exceed available quantity ({q})" msgstr "" -#: build/views.py:289 stock/views.py:831 +#: build/views.py:289 stock/views.py:834 #, python-brace-format msgid "The following serial numbers already exist: ({sn})" msgstr "" @@ -459,51 +459,80 @@ msgstr "" msgid "Serialized {n} items" msgstr "" -#: stock/views.py:396 +#: stock/templates/stock/location.html:37 +msgid "Location Details" +msgstr "" + +#: stock/templates/stock/location.html:40 +msgid "Location Path" +msgstr "" + +#: stock/templates/stock/location.html:44 +msgid "Location Description" +msgstr "" + +#: stock/templates/stock/location.html:48 +msgid "Sublocations" +msgstr "" + +#: stock/templates/stock/location.html:52 +#: stock/templates/stock/location.html:64 +msgid "Stock Items" +msgstr "" + +#: stock/templates/stock/location.html:57 +msgid "Stock Details" +msgstr "" + +#: stock/templates/stock/location.html:60 +msgid "Stock Locations" +msgstr "" + +#: stock/views.py:399 msgid "Must enter integer value" msgstr "" -#: stock/views.py:401 +#: stock/views.py:404 msgid "Quantity must be positive" msgstr "" -#: stock/views.py:408 +#: stock/views.py:411 #, python-brace-format msgid "Quantity must not exceed {x}" msgstr "" -#: stock/views.py:416 +#: stock/views.py:419 msgid "Confirm stock adjustment" msgstr "" -#: stock/views.py:484 +#: stock/views.py:487 #, python-brace-format msgid "Added stock to {n} items" msgstr "" -#: stock/views.py:499 +#: stock/views.py:502 #, python-brace-format msgid "Removed stock from {n} items" msgstr "" -#: stock/views.py:512 +#: stock/views.py:515 #, python-brace-format msgid "Counted stock for {n} items" msgstr "" -#: stock/views.py:540 +#: stock/views.py:543 msgid "No items were moved" msgstr "" -#: stock/views.py:543 +#: stock/views.py:546 #, python-brace-format msgid "Moved {n} items to {dest}" msgstr "" -#: stock/views.py:810 +#: stock/views.py:813 msgid "Invalid part selection" msgstr "" -#: stock/views.py:872 +#: stock/views.py:875 msgid "Created new stock item" msgstr "" diff --git a/InvenTree/stock/templates/stock/location.html b/InvenTree/stock/templates/stock/location.html index 45743bbd5d..baa7511726 100644 --- a/InvenTree/stock/templates/stock/location.html +++ b/InvenTree/stock/templates/stock/location.html @@ -1,5 +1,6 @@ {% extends "stock/stock_app_base.html" %} {% load static %} +{% load i18n %} {% block content %}
@@ -33,25 +34,37 @@
{% if location %} -

Location Details

+

{% trans "Location Details" %}

- + - + - + - +
Location Path{% trans "Location Path" %} {{ location.pathstring }}
Location Description{% trans "Location Description" %} {{ location.description }}
Sublocations{% trans "Sublocations" %} {{ location.children.count }}
Stock Items{% trans "Stock Items" %} {{ location.item_count }}
+ {% else %} +

{% trans "Stock Details" %}

+ + + + + + + + + +
{% trans "Stock Locations" %}{{ loc_count }}
{% trans "Stock Items" %}{{ stock_count }}
{% endif %}
diff --git a/InvenTree/stock/views.py b/InvenTree/stock/views.py index d8833d59d0..f7bbe9ad21 100644 --- a/InvenTree/stock/views.py +++ b/InvenTree/stock/views.py @@ -53,6 +53,9 @@ class StockIndex(ListView): context['locations'] = locations context['items'] = StockItem.objects.all() + context['loc_count'] = StockLocation.objects.count() + context['stock_count'] = StockItem.objects.count() + return context diff --git a/InvenTree/templates/base.html b/InvenTree/templates/base.html index 51f396df8b..94fb3bc44b 100644 --- a/InvenTree/templates/base.html +++ b/InvenTree/templates/base.html @@ -113,14 +113,8 @@ $(document).ready(function () { {% block js_ready %} {% endblock %} - /* Run document-ready scripts. - * Ref: static/script/inventree/inventree.js - */ inventreeDocReady(); - /* Display any cached alert messages - * Ref: static/script/inventree/notification.js - */ showCachedAlerts(); });