From 8a0db0e6df291536c7288e0debc0cf9430760da4 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 6 May 2018 21:53:06 +1000 Subject: [PATCH] Updated stockitem detail page - Consolidated buttons into dropdown - Stock tracking now in collapsible list --- InvenTree/stock/templates/stock/item.html | 84 ++++++++++++------- InvenTree/stock/templates/stock/location.html | 3 + InvenTree/stock/views.py | 1 + 3 files changed, 56 insertions(+), 32 deletions(-) diff --git a/InvenTree/stock/templates/stock/item.html b/InvenTree/stock/templates/stock/item.html index 50a839f52c..b759d7f9b7 100644 --- a/InvenTree/stock/templates/stock/item.html +++ b/InvenTree/stock/templates/stock/item.html @@ -2,7 +2,30 @@ {% load static %} {% block content %} -

Stock entry details

+
+
+

Stock Details

+

{{ item.quantity }} × {{ item.part.name }}

+
+
+

+
+ +
+

+
+
@@ -78,42 +101,39 @@
{% if item.has_tracking_info %} -
-

Tracking History

-
-
    -{% for track in item.tracking_info.all %} -
  • - {{ track.title }} - {% if track.notes %} -
    {{ track.notes }} - {% endif %} - {{ track.date }} - {{ track.user }} -
  • -{% endfor %} -
+
+
+
+
+

+ Stock Tracking{{ item.tracking_info.all|length }} +

+
+
+
+
    + {% for track in item.tracking_info.all %} +
  • + {{ track.title }} + {% if track.notes %} +
    {{ track.notes }} + {% endif %} + {{ track.date }} - {{ track.user }} +
  • + {% endfor %} +
+
+
+
-
- {% endif %} - - -
- -{% if item.in_stock %} - - -{% endif %} - -
- {% endblock %} {% block js_load %} {% endblock %} {% block js_ready %} - $("#edit-item").click(function () { + $("#stock-edit").click(function () { launchModalForm("#modal-form", "{% url 'stock-item-edit' item.id %}", { @@ -122,7 +142,7 @@ }); {% if item.in_stock %} - $("#move-item").click(function() { + $("#stock-move").click(function() { launchModalForm("#modal-form", "{% url 'stock-item-move' item.id %}", { @@ -130,7 +150,7 @@ }); }); - $("#stocktake").click(function() { + $("#stock-stocktake").click(function() { launchModalForm("#modal-form", "{% url 'stock-item-stocktake' item.id %}", { @@ -140,7 +160,7 @@ {% endif %} - $("#delete-item").click(function () { + $("#stock-delete").click(function () { launchDeleteForm("#modal-delete", "{% url 'stock-item-delete' item.id %}", { diff --git a/InvenTree/stock/templates/stock/location.html b/InvenTree/stock/templates/stock/location.html index 757014bee7..12f11c03e9 100644 --- a/InvenTree/stock/templates/stock/location.html +++ b/InvenTree/stock/templates/stock/location.html @@ -202,6 +202,9 @@ field: 'quantity', title: 'Stock', sortable: true, + formatter: function(value, row, index, field) { + return renderLink(value, row.url); + } }, { field: 'status', diff --git a/InvenTree/stock/views.py b/InvenTree/stock/views.py index 1b34312645..44df3911a0 100644 --- a/InvenTree/stock/views.py +++ b/InvenTree/stock/views.py @@ -141,6 +141,7 @@ class StockItemMove(AjaxUpdateView): form = self.form_class(request.POST, instance=self.get_object()) if form.is_valid(): + obj = form.save() try: