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

Use API forms for creating and editing BomItem objects

This commit is contained in:
Oliver Walters
2021-08-04 17:25:51 +10:00
parent 96a79e557b
commit 75a1be0284
5 changed files with 43 additions and 188 deletions

View File

@@ -440,22 +440,22 @@
});
$("#bom-item-new").click(function () {
launchModalForm(
"{% url 'bom-item-create' %}?parent={{ part.id }}",
{
success: function() {
$("#bom-table").bootstrapTable('refresh');
},
secondary: [
{
field: 'sub_part',
label: '{% trans "New Part" %}',
title: '{% trans "Create New Part" %}',
url: "{% url 'part-create' %}",
},
]
var fields = bomItemFields();
fields.part.value = {{ part.pk }};
fields.sub_part.filters = {
active: true,
};
constructForm('{% url "api-bom-list" %}', {
fields: fields,
method: 'POST',
title: '{% trans "Create BOM Item" %}',
onSuccess: function() {
$('#bom-table').bootstrapTable('refresh');
}
);
});
});
{% else %}