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:
@@ -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');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user