summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/pivot/pivot_view.js
diff options
context:
space:
mode:
authorAlexandre Kühn <aku@odoo.com>2018-02-19 12:29:55 +0100
committerAlexandre Kühn <aku@odoo.com>2018-02-20 09:45:52 +0100
commitae2fa4d0d67ea7b7e7452fe70405ad23cec0cd55 (patch)
treebffdcd5623af6f1cdba45f46d0ca8788a57e4530 /addons/web/static/src/js/views/pivot/pivot_view.js
parentd3372e4f8eace7ee8dfc37900f74198318662980 (diff)
[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.
Diffstat (limited to 'addons/web/static/src/js/views/pivot/pivot_view.js')
-rw-r--r--addons/web/static/src/js/views/pivot/pivot_view.js7
1 files changed, 4 insertions, 3 deletions
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];
}
},
});