[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 9b9829416b.

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) <qsm@odoo.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
This commit is contained in:
Romain Derie
2021-06-30 18:23:13 +00:00
parent 09d9924688
commit ca385eecb4
+2 -2
View File
@@ -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 "<img src='%s' width='24px' class='mr-2 rounded' /> " % (module and module.icon or mod) or ''
module_sudo = mod and request.env.ref('base.module_%s' % mod, False).sudo()
icon = mod and "<img src='%s' width='24px' class='mr-2 rounded' /> " % (module_sudo and module_sudo.icon or mod) or ''
suggested_controllers.append({
'value': url,
'label': '%s%s (%s)' % (icon, url, name),