Ensure that the user should be allowed to set the schema of an extension while creating it. Fixes #6963

This commit is contained in:
Akshay Joshi
2021-11-29 15:27:44 +05:30
parent 61b440261f
commit 2c02e6fc23
2 changed files with 8 additions and 7 deletions

View File

@@ -93,14 +93,14 @@ export default class ExtensionsSchema extends BaseUISchema {
id: 'schema', label: gettext('Schema'), type: 'select',
mode: ['properties', 'create', 'edit'], group: gettext('Definition'),
first_empty: true, deps: ['name'],
controlProps: { allowClear: false }, editable: false,
controlProps: { allowClear: true }, editable: false,
options: this.schemaList,
disabled: function (state) {
/*
* enable or disable schema field if model's relocatable
* attribute is True or False
*/
return (!state.relocatable);
if (!obj.isNew(state) && !state.relocatable) {
return true;
}
return false;
},
},
{