diff --git a/website_seo_redirection/models/ir_http.py b/website_seo_redirection/models/ir_http.py index 13fc2ac0c3..1ec4b8ff6c 100644 --- a/website_seo_redirection/models/ir_http.py +++ b/website_seo_redirection/models/ir_http.py @@ -16,6 +16,10 @@ def _dispatch(self): if not hasattr(request, "jsonrequest"): wsr = request.env["website.seo.redirection"] + # Requests at this point have no user, must remove `env` to force + # Odoo recompute it next time a controller needs it, with its user + del request.env + try: # Redirect user to SEO version of this URL if possible return wsr.redirect_auto()