diff --git a/InvenTree/templates/base.html b/InvenTree/templates/base.html index 5cd09f854e..2843264243 100644 --- a/InvenTree/templates/base.html +++ b/InvenTree/templates/base.html @@ -40,8 +40,8 @@ - - + + diff --git a/InvenTree/templates/js/translated/part.js b/InvenTree/templates/js/translated/part.js index 1bf025b629..0a27f2ba2f 100644 --- a/InvenTree/templates/js/translated/part.js +++ b/InvenTree/templates/js/translated/part.js @@ -153,12 +153,7 @@ function partFields(options={}) { delete fields['default_expiry']; } - // Additional fields when "creating" a new part - if (options.create) { - - // No supplier parts available yet - delete fields['default_supplier']; - + if (options.create || options.duplicate) { if (global_settings.PART_CREATE_INITIAL) { fields.initial_stock = { @@ -187,6 +182,13 @@ function partFields(options={}) { group: 'create', }; } + } + + // Additional fields when "creating" a new part + if (options.create) { + + // No supplier parts available yet + delete fields['default_supplier']; fields.copy_category_parameters = { type: 'boolean', @@ -349,6 +351,10 @@ function duplicatePart(pk, options={}) { duplicate: pk, }); + if (fields.initial_stock_location) { + fields.initial_stock_location.value = data.default_location; + } + // Remove "default_supplier" field delete fields['default_supplier'];