[FIX] web: stop using legacy Many2one field in kanban
Before this commit, if there was a kanban view with a field with widget="many2one" explicitely set, the legacy KanbanMany2oneField was used. That field simply displays the name of the related record, with no link. In the wowl kanban view, we only use a FieldComponent if the field is explicitely set, and we use a formatter otherwise. For that reason, this commit simply removes the kanban special case instead of re-introducing it. So by default, a many2one will be displayed in a span, and if someone wants the link in the kanban card, he has to set widget="many2one" (this wasn't possible before). Temporarily, until we remove the fallback on the legacy field registry, we need to add a "fake" entry in the wowl registry, to prevent from fallbacking on legacy. X-original-commit: a3cd97c5c81422e33a5715ecc4dd017cf5172ea8 Part-of: odoo/odoo#101661
This commit is contained in:
@@ -149,7 +149,7 @@ export class Many2OneField extends Component {
|
||||
nameCreateField: this.props.nameCreateField,
|
||||
setInputFloats: this.setFloating,
|
||||
autocomplete_container: this.autocompleteContainerRef,
|
||||
}
|
||||
};
|
||||
}
|
||||
getDomain() {
|
||||
return this.domain.toList(this.context);
|
||||
@@ -306,4 +306,6 @@ Many2OneField.extractProps = ({ attrs, field }) => {
|
||||
};
|
||||
|
||||
registry.category("fields").add("many2one", Many2OneField);
|
||||
// the two following lines are there to prevent the fallback on legacy widgets
|
||||
registry.category("fields").add("list.many2one", Many2OneField);
|
||||
registry.category("fields").add("kanban.many2one", Many2OneField);
|
||||
|
||||
Reference in New Issue
Block a user