Ruben de Pina
Ruben de Pina

Reputation: 51

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=/`;
                } - - -

Upvotes: 2

Views: 11204

Answers (4)

Ayush Shrivastava
Ayush Shrivastava

Reputation: 1

Try with this pip3 install rjsmin

it works for me

Upvotes: 0

Ijas Ahammed P
Ijas Ahammed P

Reputation: 11

just add -i base,web to you cammand line from where you create db, for example: ./odoo-bin -c ../odoo.conf -d database_name -i base,web

Upvotes: 1

Carlos Garc&#237;a
Carlos Garc&#237;a

Reputation: 71

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

Upvotes: 7

Ruben de Pina
Ruben de Pina

Reputation: 51

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,
     }

Upvotes: 3

Related Questions