2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-20 05:46:34 +00:00

Refactor ManufacturerPartCreate form

This commit is contained in:
Oliver
2021-07-12 21:32:09 +10:00
parent 0be787ea5b
commit c3b0593aba
5 changed files with 34 additions and 145 deletions

View File

@ -148,21 +148,24 @@
});
$('#manufacturer-create').click(function () {
launchModalForm(
"{% url 'manufacturer-part-create' %}",
{
reload: true,
data: {
part: {{ part.id }}
constructForm('{% url "api-manufacturer-part-list" %}', {
fields: {
part: {
value: {{ part.pk }},
hidden: true,
},
secondary: [
{
field: 'manufacturer',
label: '{% trans "New Manufacturer" %}',
title: '{% trans "Create new manufacturer" %}',
}
]
});
manufacturer: {},
MPN: {},
description: {},
link: {},
},
method: 'POST',
title: '{% trans "Add Manufacturer Part" %}',
onSuccess: function() {
$("#manufacturer-table").bootstrapTable("refresh");
}
});
});
{% endblock %}