'AttributeError 'get_frontend_session_info' odoo

I have a project in odoo15 running and created database, but after to try to open login page i have this error. Someone can help me please.

Error when render the template
AttributeError: 'ir.http' object has no attribute 'get_frontend_session_info'
Template: web.frontend_layout
Path: /t/html/head/script[2]/t
Node: <t t-out="json.dumps(request.env['ir.http'].get_frontend_session_info())"/>;
                if (!/(^|;\s)tz=/.test(document.cookie)) {
                    const userTZ = Intl.DateTimeFormat().resolvedOptions().timeZone;
                    document.cookie = `tz=${userTZ}; path=/`;
                } - - -


Solution 1:[1]

Go to your list databases ../web/database/manager and delete the database created.

Install the package qrcode sudo pip install qrcode

Create again your database in ../web/database/manager

This work for me, I hope it helps you

Solution 2:[2]

For me the solution for this is go in the .../odoo/odoo/addons/base/models/ir_http.py and in this file adding the following script:

@api.model
def get_frontend_session_info(self):
     return {
         "is_admin": self.env.user._is_admin(),
         "is_system": self.env.user._is_system(),
         "is_website_user": self.env.user._is_public(),
         "user_id": self.env.user.id,
         "is_frontend": True,
     }

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Carlos GarcĂ­a
Solution 2 Ruben de Pina