From ae2fa4d0d67ea7b7e7452fe70405ad23cec0cd55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Mon, 19 Feb 2018 12:29:55 +0100 Subject: [FIX] web: pivot controller handles correct views attribute From a recent action manager refactoring (https://github.com/odoo/odoo/commit/32b8cec5361174c92c45a4975d4e02f1fb448aa2), the attribute 'views' in viewOptions is now structured as follow: viewOptions: { action: { views: [{ viewID: 1, type: 'list', }], } } instead of this: viewOptions: { action: { views: [[1, 'list']], } } The pivot view was not updated correctly, so now it should be correct. --- addons/web/static/src/js/views/pivot/pivot_view.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/views/pivot/pivot_view.js b/addons/web/static/src/js/views/pivot/pivot_view.js index 0e908f29b8c..0d42fc7bd46 100644 --- a/addons/web/static/src/js/views/pivot/pivot_view.js +++ b/addons/web/static/src/js/views/pivot/pivot_view.js @@ -101,9 +101,10 @@ var PivotView = AbstractView.extend({ _findView(params.action && params.action.views, 'form'), ]; function _findView(views, viewType) { - return _.find(views, function (view) { - return view[1] === viewType; - }) || [false, viewType]; + var view = _.find(views, function (view) { + return view.type === viewType; + }); + return [view ? view.viewID : false, viewType]; } }, }); -- cgit v1.2.3