From d33c95fc4568516c22e12fdcce901d8250c9d218 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 16 Aug 2011 16:12:36 +0200 Subject: [PATCH] [IMP] only display shortcut toggle star in case the grandparent of the viewmanager is the WebClient it's absolutely disgusting, but so far I have not find an other good way to know we're not in a weird place such as a dashboard action, so... bzr revid: xmo@openerp.com-20110816141236-f95jnr2u9s34ho95 --- addons/base/static/src/js/views.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/base/static/src/js/views.js b/addons/base/static/src/js/views.js index 6eb333b8a8a..9d299f23791 100644 --- a/addons/base/static/src/js/views.js +++ b/addons/base/static/src/js/views.js @@ -361,9 +361,11 @@ openerp.base.ViewManagerAction = openerp.base.ViewManager.extend({ }, shortcut_check : function(view) { var self = this; + var grandparent = this.widget_parent && this.widget_parent.widget_parent; // display shortcuts if on the first view for the action var $shortcut_toggle = this.$element.find('.oe-shortcut-toggle'); - if (!(view.view_type === this.views_src[0].view_type + if (!(grandparent instanceof openerp.base.WebClient) || + !(view.view_type === this.views_src[0].view_type && view.view_id === this.views_src[0].view_id)) { $shortcut_toggle.hide(); return;