diff options
| author | Fabien Meghazi <fme@openerp.com> | 2011-11-17 15:25:28 +0100 |
|---|---|---|
| committer | Fabien Meghazi <fme@openerp.com> | 2011-11-17 15:25:28 +0100 |
| commit | 4a3eca4636b44ea95d39fb49f88a58a5e06e5231 (patch) | |
| tree | 7e5cd065c97bbf86625728c86052b105697f5398 /addons/web_dashboard/static/src/js | |
| parent | efbef3177068094571e846bcd0dbf64addaf8067 (diff) | |
| parent | 36317df4b1e21995c83fab83c5b3af8758754649 (diff) | |
[FIX] dashboard does not honor action/@view_mode
lp bug: https://launchpad.net/bugs/885996 fixed
bzr revid: fme@openerp.com-20111117142528-qydykmkvrdxefp8f
Diffstat (limited to 'addons/web_dashboard/static/src/js')
| -rw-r--r-- | addons/web_dashboard/static/src/js/dashboard.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index 5ee3427fda6..ce52b426022 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -221,6 +221,20 @@ 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 && view_mode != action.view_mode) { + var action_view_mode = action.view_mode.split(','); + action.views = _.map(view_mode.split(','), function(mode) { + if (_.indexOf(action_view_mode, mode) < 0) { + return [false, mode == 'tree' ? 'list': mode]; + } else { + mode = mode === 'tree' ? 'list' : mode; + return _.find(action.views, function(view) { + return view[1] == mode; + }); + } + }); + } action.flags = { search_view : false, sidebar : false, |
