From 79639d95cbdbb96bd7a50b3b4e100fc6660e39b4 Mon Sep 17 00:00:00 2001 From: tarteo Date: Mon, 13 Feb 2017 16:56:34 +0100 Subject: [PATCH] [MIG] Loading shortcuts --- web_shortcut/models/web_shortcut.py | 4 ++-- web_shortcut/static/src/xml/web_shortcut.xml | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/web_shortcut/models/web_shortcut.py b/web_shortcut/models/web_shortcut.py index 9065e2de..ffe6a854 100644 --- a/web_shortcut/models/web_shortcut.py +++ b/web_shortcut/models/web_shortcut.py @@ -37,8 +37,8 @@ class WebShortcut(models.Model): ] @api.model - def get_user_shortcuts(self, user_id): - shortcuts = self.search([('user_id', '=', user_id)]) + def get_user_shortcuts(self): + shortcuts = self.search([('user_id', '=', self.env.user.id)]) res = [] for shortcut in shortcuts.filtered('menu_id'): _name = shortcut.menu_id.name_get() diff --git a/web_shortcut/static/src/xml/web_shortcut.xml b/web_shortcut/static/src/xml/web_shortcut.xml index c471658f..82012653 100644 --- a/web_shortcut/static/src/xml/web_shortcut.xml +++ b/web_shortcut/static/src/xml/web_shortcut.xml @@ -18,10 +18,20 @@ + + + + + + + +