Reputation: 51
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
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
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
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