diff options
| author | len-odoo <len@odoo.com> | 2018-10-12 08:29:09 +0000 |
|---|---|---|
| committer | len-odoo <len@odoo.com> | 2018-10-12 10:13:50 +0000 |
| commit | ad79cc09c6f33da54de47ab3a9a15aacb61bb3fd (patch) | |
| tree | bdf2a90b3ed510ff20ed6b31d4ed4acc8e8ee988 /addons/web/static/src/js/fields/relational_fields.js | |
| parent | fc1ba68c6a5935b4e86c2709de049aac9867f56d (diff) | |
[FIX] web: don't allow reference widget to be set on char fields
The reference widget is expecting a models list as selection attribute
in the field declaration.
It does not exist in the case of the char field.
Support for char fields was added to allow for external identifiers,
but it only works in readonly.
As a consequence, it tracebacks in Edit mode when used in studio.
We thusly remove char field from the list of supported fields.
opw 1892602
closes odoo/odoo#27708
Diffstat (limited to 'addons/web/static/src/js/fields/relational_fields.js')
| -rw-r--r-- | addons/web/static/src/js/fields/relational_fields.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index 07e31443ffa..dcbd9dc09fd 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -2252,10 +2252,12 @@ var FieldRadio = FieldSelection.extend({ * a FieldMany2one for its value. * Its intern representation is similar to the many2one (a datapoint with a * `name_get` as data). + * Note that there is some logic to support char field because of one use in our + * codebase, but this use should be removed along with this note. */ var FieldReference = FieldMany2One.extend({ specialData: "_fetchSpecialReference", - supportedFieldTypes: ['char', 'reference'], + supportedFieldTypes: ['reference'], template: 'FieldReference', events: _.extend({}, FieldMany2One.prototype.events, { 'change select': '_onSelectionChange', |
