Skip to Content
Menu
This question has been flagged

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');
     console.log(session);
This works perfectly fine in the backend, but not in the frontend (the actual website)
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. 

Avatar
Discard
Related Posts Replies Views Activity
1
Aug 16
4998
0
Mar 15
4223
2
Oct 19
9672
1
Feb 18
3334
0
May 17
3528