Merge PR #2445 into 15.0

Signed-off-by gurneyalex
pull/2456/head
OCA-git-bot 2022-11-02 11:49:44 +00:00
commit f23632d6ad
2 changed files with 15 additions and 5 deletions

View File

@ -16,7 +16,9 @@ class AuditlogHTTPRequest(models.Model):
name = fields.Char("Path") name = fields.Char("Path")
root_url = fields.Char("Root URL") root_url = fields.Char("Root URL")
user_id = fields.Many2one("res.users", string="User") user_id = fields.Many2one("res.users", string="User")
http_session_id = fields.Many2one("auditlog.http.session", string="Session") http_session_id = fields.Many2one(
"auditlog.http.session", string="Session", index=True
)
user_context = fields.Char("Context") user_context = fields.Char("Context")
log_ids = fields.One2many("auditlog.log", "http_request_id", string="Logs") log_ids = fields.One2many("auditlog.log", "http_request_id", string="Logs")

View File

@ -19,8 +19,12 @@ class AuditlogLog(models.Model):
user_id = fields.Many2one("res.users", string="User") user_id = fields.Many2one("res.users", string="User")
method = fields.Char(size=64) method = fields.Char(size=64)
line_ids = fields.One2many("auditlog.log.line", "log_id", string="Fields updated") line_ids = fields.One2many("auditlog.log.line", "log_id", string="Fields updated")
http_session_id = fields.Many2one("auditlog.http.session", string="Session") http_session_id = fields.Many2one(
http_request_id = fields.Many2one("auditlog.http.request", string="HTTP Request") "auditlog.http.session", string="Session", index=True
)
http_request_id = fields.Many2one(
"auditlog.http.request", string="HTTP Request", index=True
)
log_type = fields.Selection( log_type = fields.Selection(
[("full", "Full log"), ("fast", "Fast log")], string="Type" [("full", "Full log"), ("fast", "Fast log")], string="Type"
) )
@ -70,8 +74,12 @@ class AuditlogLogLine(models.Model):
res_id = fields.Integer(related="log_id.res_id", store=True) res_id = fields.Integer(related="log_id.res_id", store=True)
user_id = fields.Many2one(related="log_id.user_id", store=True) user_id = fields.Many2one(related="log_id.user_id", store=True)
method = fields.Char(related="log_id.method", store=True) method = fields.Char(related="log_id.method", store=True)
http_session_id = fields.Many2one(related="log_id.http_session_id", store=True) http_session_id = fields.Many2one(
http_request_id = fields.Many2one(related="log_id.http_request_id", store=True) related="log_id.http_session_id", store=True, index=True
)
http_request_id = fields.Many2one(
related="log_id.http_request_id", store=True, index=True
)
log_type = fields.Selection(related="log_id.log_type", store=True) log_type = fields.Selection(related="log_id.log_type", store=True)
@api.model_create_multi @api.model_create_multi