[FIX] web: pivot cell clicking when no current list/form view
When clicking a pivot cell, an action is triggered using the cell data and current action list view and form view. If no list view and/or form view exists for the current viewmanager, the action chooses the default list and/or form view. The fallback when there is no list and/or form view was broken with commit https://github.com/odoo/odoo/commit/002660a9b05cf8620e1c5287a8538ac5e806d59e#diff-9e64efee6e4d81d03c04c0aad259d99cL280, when the views internal data were restructured. Fixes #14392.
This commit is contained in:
@@ -275,9 +275,10 @@ var PivotView = View.extend({
|
||||
col_domain = this.headers[col_id].domain,
|
||||
context = _.omit(_.clone(this.context), 'group_by');
|
||||
|
||||
var views = _.filter(this.options.action.views, function (view) {
|
||||
return view[1] === 'form' || view[1] === 'list';
|
||||
});
|
||||
var views = [
|
||||
_find_view_info.call(this, "list"),
|
||||
_find_view_info.call(this, "form"),
|
||||
];
|
||||
|
||||
return this.do_action({
|
||||
type: 'ir.actions.act_window',
|
||||
@@ -290,6 +291,12 @@ var PivotView = View.extend({
|
||||
context: context,
|
||||
domain: this.domain.concat(row_domain, col_domain),
|
||||
});
|
||||
|
||||
function _find_view_info(view_type) {
|
||||
return _.find(this.options.action.views, function (view) {
|
||||
return view[1] === view_type;
|
||||
}) || [false, view_type];
|
||||
}
|
||||
},
|
||||
on_measure_row_click: function (event) {
|
||||
var $target = $(event.target),
|
||||
|
||||
Reference in New Issue
Block a user