From bcb245e74912f6c4fe7017e8fbaffa3a35ab0dc4 Mon Sep 17 00:00:00 2001 From: niyasraphy Date: Thu, 23 Mar 2023 12:32:14 +0000 Subject: [PATCH] [FIX] web: traceback on accessing home page before this commit, after running an older version, lets say odoo 14 and trying to access 16 in the same browser return traceback without redirecting to db selector page and this happens due to the missing env in request, which returns as None. after this commit, no traceback wont be shown and will open the db selector page closes odoo/odoo#118851 X-original-commit: 900303c18243e3b97414b3dbf5eb7ee5b8c9c080 Signed-off-by: Julien Castiaux (juc) --- addons/web/controllers/home.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/controllers/home.py b/addons/web/controllers/home.py index 7d741546a33..455e423aec4 100644 --- a/addons/web/controllers/home.py +++ b/addons/web/controllers/home.py @@ -29,7 +29,7 @@ class Home(http.Controller): @http.route('/', type='http', auth="none") def index(self, s_action=None, db=None, **kw): - if request.session.uid and not is_user_internal(request.session.uid): + if request.db and request.session.uid and not is_user_internal(request.session.uid): return request.redirect_query('/web/login_successful', query=request.params) return request.redirect_query('/web', query=request.params)