[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
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user