2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-14 15:41:10 +00:00

Related parts are now created via the API

This commit is contained in:
Oliver
2021-11-25 14:23:27 +11:00
parent 2065c05519
commit 68f7887379
5 changed files with 19 additions and 125 deletions

View File

@@ -759,11 +759,25 @@
);
$("#add-related-part").click(function() {
launchModalForm("{% url 'part-related-create' %}", {
data: {
part: {{ part.id }},
constructForm('{% url "api-part-related-list" %}', {
method: 'POST',
fields: {
part_1: {
hidden: true,
value: {{ part.pk }},
},
part_2: {
label: '{% trans "Related Part" %}',
filters: {
exclude_related: {{ part.pk }},
}
}
},
reload: true,
title: '{% trans "Add Related Part" %}',
onSuccess: function() {
$('#related-parts-table').bootstrapTable('refresh');
}
});
});