From f90e630dabad6d2fac43cfb34324cb5705e73446 Mon Sep 17 00:00:00 2001 From: "Kunal Chavda (OpenERP)" Date: Thu, 10 Nov 2011 15:13:03 +0530 Subject: [PATCH] [FIX]Fixed code for consider view mode attrs as first priority. lp bug: https://launchpad.net/bugs/885996 fixed bzr revid: kch@tinyerp.com-20111110094303-s63381get48xrn2u --- addons/web_dashboard/static/src/js/dashboard.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index e629a4a6ef5..5221df9ce19 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -221,6 +221,15 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ var self = this; var action_orig = _.extend({}, result.result); var action = result.result; + var view_mode = this.actions_attrs[action.id]['view_mode']; + if(view_mode) { + action.views = _.map(view_mode.split(','), function(mode){ + mode = mode === 'tree' ? 'list': mode; + return _.find(action.views, function(view) { + return view[1] == mode; + }); + }); + } action.flags = { search_view : false, sidebar : false,