gooderp18绿色标准版
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

26 行
782B

  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. import odoo
  4. import odoo.exceptions
  5. from odoo.modules.registry import Registry
  6. def check(db, uid, passwd):
  7. res_users = Registry(db)['res.users']
  8. return res_users.check(db, uid, passwd)
  9. def compute_session_token(session, env):
  10. self = env['res.users'].browse(session.uid)
  11. return self._compute_session_token(session.sid)
  12. def check_session(session, env, request=None):
  13. self = env['res.users'].browse(session.uid)
  14. expected = self._compute_session_token(session.sid)
  15. if expected and odoo.tools.misc.consteq(expected, session.session_token):
  16. if request:
  17. env['res.device.log']._update_device(request)
  18. return True
  19. return False
上海开阖软件有限公司 沪ICP备12045867号-1