[FIX]Fixed code for consider view mode attrs as first priority.
authorKunal Chavda (OpenERP) <kch@tinyerp.com>
Thu, 10 Nov 2011 09:43:03 +0000 (15:13 +0530)
committerKunal Chavda (OpenERP) <kch@tinyerp.com>
Thu, 10 Nov 2011 09:43:03 +0000 (15:13 +0530)
lp bug: https://launchpad.net/bugs/885996 fixed

bzr revid: kch@tinyerp.com-20111110094303-s63381get48xrn2u

addons/web_dashboard/static/src/js/dashboard.js

index e629a4a..5221df9 100644 (file)
@@ -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,