Fixes for stock location forms

This commit is contained in:
Oliver 2022-01-08 20:28:57 +11:00
parent af18d16d98
commit ff7a75266b
2 changed files with 8 additions and 0 deletions

View File

@ -426,6 +426,7 @@ class LocationSerializer(InvenTree.serializers.InvenTreeModelSerializer):
'parent',
'pathstring',
'items',
'owner',
]

View File

@ -111,12 +111,17 @@ function stockLocationFields(options={}) {
},
name: {},
description: {},
owner: {},
};
if (options.parent) {
fields.parent.value = options.parent;
}
if (!global_settings.STOCK_OWNERSHIP_CONTROL) {
delete fields['owner'];
}
return fields;
}
@ -130,6 +135,8 @@ function editStockLocation(pk, options={}) {
options.fields = stockLocationFields(options);
options.title = '{% trans "Edit Stock Location" %}';
constructForm(url, options);
}