Browse Source

[IMP] Clean pu

pull/564/head
tarteo 8 years ago
parent
commit
1611185af8
  1. 14
      web_shortcut/static/src/js/web_shortcut.js
  2. 3
      web_shortcut/static/src/xml/web_shortcut.xml

14
web_shortcut/static/src/js/web_shortcut.js

@ -26,7 +26,8 @@ odoo.define('web.shortcut', function(require) {
action_manager = require('web.ActionManager'), action_manager = require('web.ActionManager'),
core = require('web.core'), core = require('web.core'),
qweb = core.qweb, qweb = core.qweb,
model = require('web.DataModel');
model = require('web.DataModel'),
session = require('web.session');
var ShortcutMenu = widget.extend({ var ShortcutMenu = widget.extend({
@ -143,8 +144,9 @@ odoo.define('web.shortcut', function(require) {
// display shortcuts if on the first view for the action // display shortcuts if on the first view for the action
var $shortcut_toggle = this.action_manager.$el.find('.oe_shortcut_toggle'); var $shortcut_toggle = this.action_manager.$el.find('.oe_shortcut_toggle');
if (!this.action.name || 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'); $shortcut_toggle.addClass('hidden');
return; return;
} }
@ -159,9 +161,9 @@ odoo.define('web.shortcut', function(require) {
shortcuts_menu.trigger('remove', self.session.active_id); shortcuts_menu.trigger('remove', self.session.active_id);
} else { } else {
shortcuts_menu.trigger('add', { 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"); $shortcut_toggle.toggleClass("oe_shortcut_remove");

3
web_shortcut/static/src/xml/web_shortcut.xml

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- vim:fdl=1:
-->
<templates> <templates>
<t t-name="Systray.ShortcutMenu"> <t t-name="Systray.ShortcutMenu">
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle o_priority_star fa fa-star" data-toggle="dropdown"/> <a href="#" class="dropdown-toggle o_priority_star fa fa-star" data-toggle="dropdown"/>

Loading…
Cancel
Save