Files
odoo_source/addons/web_tour/models/ir_http.py
T
Aaron Bohy 66c716d781 [FIX] *: adapt calls to _is_superuser
Rev. 2f7c03d added a second admin user (id 2), the 'human' one, on
top of the 'technical' one (id 1, also known as the superuser).
Basically, all calls to _is_superuser() should have been changed to
_is_admin(). They weren't. As a consequence, some features that
were previously available for the admin weren't anymore (e.g.
tours).

This rev. replaces all calls to _is_superuser() by calls to
_is_admin().
2018-09-18 20:31:28 +02:00

16 lines
431 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
from odoo.http import request
class Http(models.AbstractModel):
_inherit = 'ir.http'
def session_info(self):
result = super(Http, self).session_info()
if result['is_admin']:
result['web_tours'] = request.env['web_tour.tour'].get_consumed_tours()
return result