From 8459de7be24da44bfa77a70ae67210ebfd666e78 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 30 May 2020 20:58:05 +1000 Subject: [PATCH 1/2] Display a message if no stock location is set --- InvenTree/stock/templates/stock/item_base.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html index bc187588d0..56ef8a3370 100644 --- a/InvenTree/stock/templates/stock/item_base.html +++ b/InvenTree/stock/templates/stock/item_base.html @@ -144,11 +144,15 @@ InvenTree | {% trans "Stock Item" %} - {{ item }} {% trans "Build Order" %} {{ item.build_order }} - {% elif item.location %} + {% else %} {% trans "Location" %} + {% if item.location %} {{ item.location.name }} + {% else %} + {% trans "No location set" %} + {% endif %} {% endif %} {% if item.uid %} From dd9584f487d61d2e2ce8d677b1bcc1d696ba3bea Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 30 May 2020 20:58:52 +1000 Subject: [PATCH 2/2] Follow link when a new stock item is created --- InvenTree/stock/templates/stock/location.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/InvenTree/stock/templates/stock/location.html b/InvenTree/stock/templates/stock/location.html index 478776c421..f92539cab8 100644 --- a/InvenTree/stock/templates/stock/location.html +++ b/InvenTree/stock/templates/stock/location.html @@ -189,9 +189,7 @@ $('#item-create').click(function () { launchModalForm("{% url 'stock-item-create' %}", { - success: function() { - $("#stock-table").bootstrapTable('refresh'); - }, + follow: true, data: { {% if location %} location: {{ location.id }}