From 6ef1644a7b3812f4cc0d066ea74970791a4b4d54 Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Tue, 19 Jul 2016 16:59:53 +0200 Subject: [PATCH] [FIX] web: session_info: `is_admin` check The tour mechanism displays a tour if the `session.is_admin` key is set to True. For this key to bet set to True, you need to be in the system group. Default options adds the system group to any created user, however as there aren't any ir.model.access rule defined on the `web_tour.tour` model, when you try to login as this created user, you get a traceback. As the only way to reach a `web_tour.tour` record is to have the superuser_id, update the `is_admin` condition accordingly. --- addons/web/models/ir_http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/models/ir_http.py b/addons/web/models/ir_http.py index 5e239bbb816..2b4b7509b52 100644 --- a/addons/web/models/ir_http.py +++ b/addons/web/models/ir_http.py @@ -21,7 +21,7 @@ class Http(models.AbstractModel): return { "session_id": request.session_id, "uid": request.session.uid, - "is_admin": request.env.user.has_group('base.group_system'), + "is_admin": request.env.uid == openerp.SUPERUSER_ID, "user_context": request.session.get_context() if request.session.uid else {}, "db": request.session.db, "server_version": version_info.get('server_version'),