From ad79cc09c6f33da54de47ab3a9a15aacb61bb3fd Mon Sep 17 00:00:00 2001 From: len-odoo Date: Fri, 12 Oct 2018 08:29:09 +0000 Subject: [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 --- addons/web/static/src/js/fields/relational_fields.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/fields') 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', -- cgit v1.2.3