From 4e6c8c45ee6f4e6cf500fadaa91f4fe655dfbde9 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 8 Aug 2021 00:44:46 +1000 Subject: [PATCH] secondary modal for part form --- InvenTree/templates/js/translated/part.js | 14 ++++++++++++-- InvenTree/templates/js/translated/stock.js | 12 ++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/InvenTree/templates/js/translated/part.js b/InvenTree/templates/js/translated/part.js index 3def7abdad..6f51f492c4 100644 --- a/InvenTree/templates/js/translated/part.js +++ b/InvenTree/templates/js/translated/part.js @@ -17,7 +17,16 @@ function yesNoLabel(value) { function partFields(options={}) { var fields = { - category: {}, + category: { + secondary: { + title: '{% trans "Add Part Category" %}', + fields: function(data) { + var fields = categoryFields(); + + return fields; + } + } + }, name: {}, IPN: {}, revision: {}, @@ -30,7 +39,8 @@ function partFields(options={}) { link: { icon: 'fa-link', }, - default_location: {}, + default_location: { + }, default_supplier: {}, default_expiry: { icon: 'fa-calendar-alt', diff --git a/InvenTree/templates/js/translated/stock.js b/InvenTree/templates/js/translated/stock.js index 826048471d..36b3bea03a 100644 --- a/InvenTree/templates/js/translated/stock.js +++ b/InvenTree/templates/js/translated/stock.js @@ -2,6 +2,18 @@ {% load inventree_extras %} {% load status_codes %} + +function locationFields() { + return { + parent: { + help_text: '{% trans "Parent stock location" %}', + }, + name: {}, + description: {}, + }; +} + + /* Stock API functions * Requires api.js to be loaded first */