The website frontend apps menu list is not working when the user has a `Home Action` defined on his user. The `Home Action` is meant to redirect to the defined action whenever that user is login in. But since the backend menu links on the website have most of the time no `action` defined but just a `menu_id` defined, the `Home Action` will kick in and take over the redirection, the same way as if the user just type `/web` without any params. To solve that, we simply force the `action` of those links (if they don't already have one). This will make sure that the redirect is working as it should for users having a `Home Action` set. Step to reproduce: - Set a Home Action for any user, like "Contacts" - Go to the website frontend, eg on `/`. - Click on the top left button to show the backend app menus list - Click on any menu (CRM, Invoicing, Calendar..) -> Most of those menu will not redirect you were you are supposed to be but on your Home Action instead. You can figure which one will be buggy or not by just mouseovering the link and see if the URL param `action` is set to something or not. --- Technical hints --- There is multiple methods to get the list of menus in Odoo: - `load_web_menus`: called by the web client rpc, calling `load_menus`. If a top/app menu has no action defined on it, it sets the first found action of their children menus to it. It returns the full (flat) list of menus, not only the top/app ones. This method is not ormcached but is calling an ormcached method and just doing some tiny work on the data. - `load_menus_root`: called only by website backend template to add the app list on the website (in the frontend) to jump to the backend. It does not force the action if a menu has no action set on it. It returns only the top/app menus. This method is ormcached. Note that this method seems only used by the website module. - `load_menus`: returns the full (flat) list of menus without a force action This method is ormcached. Fixes https://github.com/odoo/odoo/issues/119971 task-3378963 closes odoo/odoo#127840 X-original-commit: f28a349aa40b2ea48ef8f2b71e806b965777014f Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Signed-off-by: Romain Derie (rde) <rde@odoo.com>
34 lines
912 B
Python
34 lines
912 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from . import assets
|
|
from . import base_partner_merge
|
|
from . import ir_actions_server
|
|
from . import ir_asset
|
|
from . import ir_attachment
|
|
from . import ir_binary
|
|
from . import ir_http
|
|
from . import ir_model
|
|
from . import ir_model_data
|
|
from . import ir_module_module
|
|
from . import ir_qweb
|
|
from . import ir_qweb_fields
|
|
from . import mixins
|
|
from . import website
|
|
from . import website_menu
|
|
from . import website_page
|
|
from . import website_rewrite
|
|
from . import ir_rule
|
|
from . import ir_ui_menu
|
|
from . import ir_ui_view
|
|
from . import res_company
|
|
from . import res_partner
|
|
from . import res_users
|
|
from . import res_config_settings
|
|
from . import res_lang
|
|
from . import theme_models
|
|
from . import website_configurator_feature
|
|
from . import website_form
|
|
from . import website_snippet_filter
|
|
from . import website_visitor
|