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

Refactored DuplicatePart form

- API endpoint now takes care of duplication of other data
This commit is contained in:
Oliver Walters
2021-08-05 00:16:42 +10:00
parent 2cb0b448b7
commit 0e8fb6a5ad
5 changed files with 43 additions and 132 deletions

View File

@ -110,6 +110,19 @@ function partFields(options={}) {
html: `<hr><h4><i>{% trans "Part Duplication Options" %}</i></h4><hr>`,
};
fields.copy_from = {
type: 'integer',
hidden: true,
value: options.duplicate,
},
fields.copy_image = {
type: 'boolean',
label: '{% trans "Copy Image" %}',
help_text: '{% trans "Copy image from original part" %}',
value: true,
},
fields.copy_bom = {
type: 'boolean',
label: '{% trans "Copy BOM" %}',
@ -184,7 +197,7 @@ function duplicatePart(pk, options={}) {
success: function(response) {
var fields = partFields({
duplicate: true
duplicate: pk,
});
constructForm('{% url "api-part-list" %}', {