From 1611185af842f1b55ad11950ef80d9d8502e3df6 Mon Sep 17 00:00:00 2001 From: tarteo Date: Thu, 23 Feb 2017 16:41:00 +0100 Subject: [PATCH] [IMP] Clean pu --- web_shortcut/README.rst | 2 +- web_shortcut/static/src/js/web_shortcut.js | 14 ++++++++------ web_shortcut/static/src/xml/web_shortcut.xml | 3 +-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/web_shortcut/README.rst b/web_shortcut/README.rst index 3e4ae7c9..6bf7a37f 100644 --- a/web_shortcut/README.rst +++ b/web_shortcut/README.rst @@ -6,7 +6,7 @@ Shortcut Menu ============= -Adds a button to the top menu which opens a menu containing the user's shortcuts. +Adds a button to the top menu which opens a menu containing the user's shortcuts. Configuration ============= diff --git a/web_shortcut/static/src/js/web_shortcut.js b/web_shortcut/static/src/js/web_shortcut.js index e66855a2..13fbcb3c 100644 --- a/web_shortcut/static/src/js/web_shortcut.js +++ b/web_shortcut/static/src/js/web_shortcut.js @@ -26,7 +26,8 @@ odoo.define('web.shortcut', function(require) { action_manager = require('web.ActionManager'), core = require('web.core'), qweb = core.qweb, - model = require('web.DataModel'); + model = require('web.DataModel'), + session = require('web.session'); var ShortcutMenu = widget.extend({ @@ -143,8 +144,9 @@ odoo.define('web.shortcut', function(require) { // display shortcuts if on the first view for the action var $shortcut_toggle = this.action_manager.$el.find('.oe_shortcut_toggle'); if (!this.action.name || - !(view.view_type === this.view_stack[0].view_type - && view.view_id === this.view_stack[0].view_id)) { + !(view.view_type === this.view_stack[0].view_type && + view.view_id === this.view_stack[0].view_id) + ) { $shortcut_toggle.addClass('hidden'); return; } @@ -159,9 +161,9 @@ odoo.define('web.shortcut', function(require) { shortcuts_menu.trigger('remove', self.session.active_id); } else { shortcuts_menu.trigger('add', { - 'user_id': self.session.uid, - 'menu_id': self.session.active_id, - 'name': self.action.name + 'user_id': session.uid, + 'menu_id': session.active_id, + 'name': session.name }); } $shortcut_toggle.toggleClass("oe_shortcut_remove"); diff --git a/web_shortcut/static/src/xml/web_shortcut.xml b/web_shortcut/static/src/xml/web_shortcut.xml index 70d3da38..916cd38b 100644 --- a/web_shortcut/static/src/xml/web_shortcut.xml +++ b/web_shortcut/static/src/xml/web_shortcut.xml @@ -1,7 +1,6 @@ - +