diff --git a/InvenTree/common/serializers.py b/InvenTree/common/serializers.py index e5c6c18b76..35a1c79879 100644 --- a/InvenTree/common/serializers.py +++ b/InvenTree/common/serializers.py @@ -32,7 +32,15 @@ class SettingsSerializer(InvenTreeModelSerializer): Returns the choices available for a given item """ - return obj.choices() + results = [] + + for choice in obj.choices(): + results.append({ + 'value': choice[0], + 'display_name': choice[1], + }) + + return results class GlobalSettingsSerializer(SettingsSerializer): diff --git a/InvenTree/templates/js/dynamic/settings.js b/InvenTree/templates/js/dynamic/settings.js index ec74abb131..8201dc8374 100644 --- a/InvenTree/templates/js/dynamic/settings.js +++ b/InvenTree/templates/js/dynamic/settings.js @@ -39,7 +39,11 @@ function editSetting(pk, options={}) { // First, read the settings object from the server inventreeGet(url, {}, { success: function(response) { - + + if (response.choices && response.choices.length > 0) { + response.type = 'choice'; + } + // Construct the field var fields = { value: {