From c1f3bddf4505103eeba6b1878dabebbe825164ba Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 6 Jun 2019 19:28:52 +1000 Subject: [PATCH] Secondary modal for creating a new stock location when moving stock --- InvenTree/static/script/inventree/stock.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/InvenTree/static/script/inventree/stock.js b/InvenTree/static/script/inventree/stock.js index facbaa65f5..ae3ab55a7e 100644 --- a/InvenTree/static/script/inventree/stock.js +++ b/InvenTree/static/script/inventree/stock.js @@ -195,6 +195,18 @@ function loadStockTable(table, options) { stock.push(item.pk); }); + // Buttons for launching secondary modals + var secondary = []; + + if (action == 'move') { + secondary.push({ + field: 'destination', + label: 'New Location', + title: 'Create new location', + url: "/stock/location/new/", + }); + } + launchModalForm("/stock/adjust/", { data: { @@ -204,6 +216,7 @@ function loadStockTable(table, options) { success: function() { $("#stock-table").bootstrapTable('refresh'); }, + secondary: secondary, } ); }