Created
November 24, 2019 18:32
-
-
Save hari4274/fc7ab11b849a88a4eb5631872c01cc4a to your computer and use it in GitHub Desktop.
To enable session_id in session/authenticate JSON-RPC call in odoo13 and above
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Part of Odoo. See LICENSE file for full copyright and licensing details. | |
from odoo import api, models | |
from odoo.http import request | |
class Http(models.AbstractModel): | |
_inherit = 'ir.http' | |
def session_info(self): | |
res = super(Http, self).session_info() | |
if not res.get('session_id'): | |
# Add Session Id | |
res['session_id'] = request.session.sid | |
return res |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment