2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-03 04:00:57 +00:00

Merge branch 'master' of https://github.com/inventree/InvenTree into plugin-2037

This commit is contained in:
Matthias
2021-12-02 17:16:26 +01:00
15 changed files with 136 additions and 47 deletions

View File

@ -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'];