1 parent f871405 commit a9bbf8eCopy full SHA for a9bbf8e
1 file changed
auditlog/models/http_session.py
@@ -13,9 +13,9 @@ class AuditlogtHTTPSession(models.Model):
13
_rec_name = 'display_name'
14
15
display_name = fields.Char(u"Name", compute="_display_name")
16
- name = fields.Char(u"Session ID")
+ name = fields.Char(u"Session ID", index=True)
17
user_id = fields.Many2one(
18
- 'res.users', string=u"User")
+ 'res.users', string=u"User", index=True)
19
http_request_ids = fields.One2many(
20
'auditlog.http.request', 'http_session_id', string=u"HTTP Requests")
21
@@ -43,7 +43,8 @@ def current_http_session(self):
43
if httpsession:
44
existing_session = self.search(
45
[('name', '=', httpsession.sid),
46
- ('user_id', '=', request.uid)])
+ ('user_id', '=', request.uid)],
47
+ limit=1)
48
if existing_session:
49
return existing_session.id
50
vals = {
0 commit comments