From 3dae59cabdcb6e0bf37fad5b98fe091df925d0d3 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Thu, 15 Nov 2012 15:44:55 +0100 Subject: [PATCH 1/3] [FIX]7.0 bookmark module - not working correctly lp bug: https://launchpad.net/bugs/1077138 fixed bzr revid: dle@openerp.com-20121115144455-gdpss6sp4ul5zut3 --- addons/web_shortcuts/static/src/js/web_shortcuts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_shortcuts/static/src/js/web_shortcuts.js b/addons/web_shortcuts/static/src/js/web_shortcuts.js index e7cbbaccef6..583069cc3d1 100644 --- a/addons/web_shortcuts/static/src/js/web_shortcuts.js +++ b/addons/web_shortcuts/static/src/js/web_shortcuts.js @@ -54,7 +54,7 @@ instance.web_shortcuts.Shortcuts = instance.web.Widget.extend({ }, add: function (sc) { var self = this; - this.dataset.create(sc, function (out) { + this.dataset.create(sc).then(function(out){ self.trigger('display', { name : sc.name, id : out.result, From bba12d9e95d681e17d2898ea598ac0f1f4e90207 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Thu, 15 Nov 2012 16:57:08 +0100 Subject: [PATCH 2/3] [FIX]wrong out id when adding shortcut to system tray list lp bug: https://launchpad.net/bugs/1077138 fixed bzr revid: dle@openerp.com-20121115155708-vbz1djvtp15dit78 --- addons/web_shortcuts/static/src/js/web_shortcuts.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/web_shortcuts/static/src/js/web_shortcuts.js b/addons/web_shortcuts/static/src/js/web_shortcuts.js index 583069cc3d1..04fa09e300c 100644 --- a/addons/web_shortcuts/static/src/js/web_shortcuts.js +++ b/addons/web_shortcuts/static/src/js/web_shortcuts.js @@ -57,7 +57,7 @@ instance.web_shortcuts.Shortcuts = instance.web.Widget.extend({ this.dataset.create(sc).then(function(out){ self.trigger('display', { name : sc.name, - id : out.result, + id : out, res_id : sc.res_id }); }); @@ -108,24 +108,24 @@ instance.web.UserMenu.include({ }); instance.web.ViewManagerAction.include({ - switch_mode: function (view_type, no_store) { + switch_mode: function () { var self = this; this._super.apply(this, arguments).done(function() { - self.shortcut_check(self.views[view_type]); + self.shortcut_check(); }); }, - shortcut_check : function(view) { + shortcut_check : function() { var self = this; var shortcuts_menu = instance.webclient.user_menu.shortcuts; var grandparent = this.getParent() && this.getParent().getParent(); // display shortcuts if on the first view for the action var $shortcut_toggle = this.$el.find('.oe_shortcuts_toggle'); - if (!this.action.name || + /*if (!this.action.name || !(view.view_type === this.views_src[0].view_type && view.view_id === this.views_src[0].view_id)) { $shortcut_toggle.hide(); return; - } + }*/ $shortcut_toggle.toggleClass('oe_shortcuts_remove', shortcuts_menu.has(self.session.active_id)); $shortcut_toggle.unbind("click").click(function() { if ($shortcut_toggle.hasClass("oe_shortcuts_remove")) { From e72542b6ecf4efdcb1539abc29e065bc8a1ec5a8 Mon Sep 17 00:00:00 2001 From: "Denis Ledoux dle@openerp.com" <> Date: Thu, 15 Nov 2012 17:05:50 +0100 Subject: [PATCH 3/3] [FIX]Reload whole favorites (by rpc call) instead of adding the new one, otherwise the name of the new starred item is not structured like the other ones lp bug: https://launchpad.net/bugs/1077138 fixed bzr revid: dle@openerp.com-20121115160550-p5kc3j8swxu3lfv0 --- .../web_shortcuts/static/src/js/web_shortcuts.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/addons/web_shortcuts/static/src/js/web_shortcuts.js b/addons/web_shortcuts/static/src/js/web_shortcuts.js index 04fa09e300c..918feb4634d 100644 --- a/addons/web_shortcuts/static/src/js/web_shortcuts.js +++ b/addons/web_shortcuts/static/src/js/web_shortcuts.js @@ -55,11 +55,7 @@ instance.web_shortcuts.Shortcuts = instance.web.Widget.extend({ add: function (sc) { var self = this; this.dataset.create(sc).then(function(out){ - self.trigger('display', { - name : sc.name, - id : out, - res_id : sc.res_id - }); + self.trigger('load'); }); }, display: function(sc) { @@ -108,24 +104,24 @@ instance.web.UserMenu.include({ }); instance.web.ViewManagerAction.include({ - switch_mode: function () { + switch_mode: function (view_type, no_store) { var self = this; this._super.apply(this, arguments).done(function() { - self.shortcut_check(); + self.shortcut_check(self.views[view_type]); }); }, - shortcut_check : function() { + shortcut_check : function(view) { var self = this; var shortcuts_menu = instance.webclient.user_menu.shortcuts; var grandparent = this.getParent() && this.getParent().getParent(); // display shortcuts if on the first view for the action var $shortcut_toggle = this.$el.find('.oe_shortcuts_toggle'); - /*if (!this.action.name || + if (!this.action.name || !(view.view_type === this.views_src[0].view_type && view.view_id === this.views_src[0].view_id)) { $shortcut_toggle.hide(); return; - }*/ + } $shortcut_toggle.toggleClass('oe_shortcuts_remove', shortcuts_menu.has(self.session.active_id)); $shortcut_toggle.unbind("click").click(function() { if ($shortcut_toggle.hasClass("oe_shortcuts_remove")) {