Browse Source

[IMP] Clean pu

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

2
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
=============

14
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");

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

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

Loading…
Cancel
Save