From ca385eecb4e8e9e752583b17f38cdccdef9e807e Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Wed, 30 Jun 2021 13:55:40 +0000 Subject: [PATCH] [FIX] website: allow non-admin editor to get suggested links New features to show suggested links as an autocomplete when creating a menu was introduced with 9b9829416ba0b0. But it was missing a sudo, so non-admin editor could not read module records. task-2583737 closes odoo/odoo#73035 X-original-commit: d8206db3da541ba3f0c3e9cb63eab802e3ff096b Signed-off-by: Quentin Smetz (qsm) Signed-off-by: Romain Derie --- addons/website/controllers/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index a6be245194e..453ee936b84 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -291,8 +291,8 @@ class Website(Home): suggested_controllers = [] for name, url, mod in current_website.get_suggested_controllers(): if needle.lower() in name.lower() or needle.lower() in url.lower(): - module = mod and request.env.ref('base.module_%s' % mod, False) - icon = mod and " " % (module and module.icon or mod) or '' + module_sudo = mod and request.env.ref('base.module_%s' % mod, False).sudo() + icon = mod and " " % (module_sudo and module_sudo.icon or mod) or '' suggested_controllers.append({ 'value': url, 'label': '%s%s (%s)' % (icon, url, name),