[FIX] web: add the missing views in legacy_views
Before this commit, the switch from a multiple view (list, kanban, ...) to a custom form view was not correctly done. The form view displayed was not the custom version but the default one. This problem is caused by the filter applied on viewSwitcherEntries which removes the form views because they are not a multiple view. To solve this problem, we will add the missing form view in the actions.views given to the legacy view. closes odoo-dev/odoo#958 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
committed by
Aaron Bohy
parent
2e35ba0260
commit
ea0a718fb4
@@ -101,10 +101,24 @@ function registerView(name, LegacyView) {
|
||||
viewFields: result.fields_views.search.fields,
|
||||
});
|
||||
}
|
||||
const views = this.viewParams.action.views
|
||||
.filter(([vid, vtype]) => vtype !== "search")
|
||||
.map(([vid, vtype]) => {
|
||||
const view = this.props.viewSwitcherEntries.find((v) => v.type === vtype);
|
||||
if (view) {
|
||||
return Object.assign({}, view, {viewID: vid});
|
||||
} else {
|
||||
return {
|
||||
viewID: vid,
|
||||
type: vtype,
|
||||
multiRecord: !this.constructor.multiRecord,
|
||||
};
|
||||
}
|
||||
});
|
||||
this.viewParams.action = Object.assign({}, this.viewParams.action, {
|
||||
controlPanelFieldsView,
|
||||
_views: this.viewParams.action.views,
|
||||
views: this.props.viewSwitcherEntries,
|
||||
views,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user