2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 20:16:44 +00:00

Add some secondary buttons to the part-create form

This commit is contained in:
Oliver Walters 2019-05-14 23:19:56 +10:00
parent be1b458634
commit 97c4e5acbf

View File

@ -82,15 +82,35 @@
$("#part-create").click(function() { $("#part-create").click(function() {
launchModalForm( 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, field: 'category',
data: { label: 'New Category',
{% if category %} title: 'Create new Part Category',
category: {{ category.id }} url: "{% url 'category-create' %}",
{% endif %} }
} );
});
attachSecondaryModal(modal,
{
field: 'default_location',
label: 'New Location',
title: 'Create new Stock Location',
url: "{% url 'stock-location-create' %}",
}
);
}
}
);
}); });
{% if category %} {% if category %}