Backport fix on session check crash (PR 33)

This commit is contained in:
jcoux
2018-10-30 08:54:01 +01:00
parent 7fc296d73e
commit a3c61c6c6c
3 changed files with 21 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
from . import user
+19
View File
@@ -0,0 +1,19 @@
from openerp import models, tools
class User(models.Model):
_inherit = 'res.users'
@tools.ormcache('sid')
def _compute_session_token(self, sid):
"""Make sure to return an unicode string.
Odoo creates a session token using hexdigest Session which is str
but with redis we set the token from a dictionary of values passing
it in json format. When dumping values from json, we always get unicode
thus both are incompatible.
The shortest path is to fix the output of the computed session by Odoo.
"""
return unicode(super(User, self)._compute_session_token(sid))