From 97c4e5acbf7569acc79663d79e6d4bcf0406ee2a Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 14 May 2019 23:19:56 +1000 Subject: [PATCH] Add some secondary buttons to the part-create form --- InvenTree/part/templates/part/category.html | 36 ++++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/InvenTree/part/templates/part/category.html b/InvenTree/part/templates/part/category.html index 286b5fc418..82cf5e5833 100644 --- a/InvenTree/part/templates/part/category.html +++ b/InvenTree/part/templates/part/category.html @@ -82,15 +82,35 @@ $("#part-create").click(function() { launchModalForm( - "{% url 'part-create' %}", + "{% url 'part-create' %}", + { + follow: true, + data: { + {% if category %} + category: {{ category.id }} + {% endif %} + }, + after_render: function(modal, response) { + attachSecondaryModal(modal, { - follow: true, - data: { - {% if category %} - category: {{ category.id }} - {% endif %} - } - }); + field: 'category', + label: 'New Category', + title: 'Create new Part Category', + url: "{% url 'category-create' %}", + } + ); + + attachSecondaryModal(modal, + { + field: 'default_location', + label: 'New Location', + title: 'Create new Stock Location', + url: "{% url 'stock-location-create' %}", + } + ); + } + } + ); }); {% if category %}