I am adding some custom data to the web session. Like this:
from odoo import models from odoo.http import request
class IrHttp(models.AbstractModel):
_inherit = 'ir.http'
def session_info(self):
result = super(IrHttp, self).session_info()
result['key1'] = get_value_1()
result['key2'] = get_value_2()
return result
def get_value_1(): ( same for get_value_2() )
return self.env['*model*'].browse(*id*).*attribute*
I will retrieve my data with:
var session = require('web.session');This works perfectly fine in the backend, but not in the frontend (the actual website)
console.log(session);
The log shows me that the custom keys are missing in the frontend. What is the reason for this, and how do I solve it?
There is no error being logged.