[FIX] base_user_role_company: wrong menus on re-login

Issue found on logout / relogin.
The user groups were applied correctly, but the main menu showed apps
the user did not have access to.

This was related to the menu caching mechanisn, that was disabled here.
This commit is contained in:
Daniel Reis
2022-03-02 12:42:30 +00:00
parent e866c7ab21
commit 90a5ad3046
3 changed files with 18 additions and 0 deletions

View File

@@ -0,0 +1 @@
from . import main

View File

@@ -0,0 +1,16 @@
# Copyright (C) 2022 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import http
from odoo.addons.web.controllers.main import Home
class HomeExtended(Home):
@http.route()
def web_load_menus(self, unique):
response = super().web_load_menus(unique)
# On logout & re-login we could see wrong menus being rendered
# To avoid this, menu http cache must be disabled
response.headers.remove("Cache-Control")
return response