TIP: You can type at any time to perform a new search.
Audit Log
auditlog · OCA/server-tools
- Repository
- OCA/server-tools · module folder · Try on Runboat
- Module version
- 2.0.0
- Category
- Tools
- Folder size
- 1.95 MB
- License
- AGPL-3
- Application
- Yes
- Auto-installable
- No
- Website
- https://github.com/OCA/server-tools
- Last tracking update
- 2026-08-07 09:06:26
- Authors
- Odoo Community Association (OCA), ABF OSIELL
- Maintainers
- Odoo Community Association (OCA), ABF OSIELL
- Committers
- Stefan Rijnhart, Cuong, Nguyen Minh Tran Manh, Weblate, Hembert Iregui, OCA-git-bot, oca-ci
- Odoo dependencies
-
odoo/odoo:- base
- Python dependencies
- None
- System dependencies
- None
- Required by
- test_auditlog
- Description
This module allows the administrator to log user operations performed on data models such as `create`, `read`, `write` and `delete`.
Code Analysis ⓘ
Views touched (14)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
view_auditlog_http_request_form |
auditlog.http.request.form | auditlog.http.request | form | New |
view_auditlog_http_request_search |
auditlog.http.request.search | auditlog.http.request | search | New |
view_auditlog_http_request_tree |
auditlog.http.request.list | auditlog.http.request | list | New |
view_auditlog_http_session_form |
auditlog.http.session.form | auditlog.http.session | form | New |
view_auditlog_http_session_search |
auditlog.http.session.search | auditlog.http.session | search | New |
view_auditlog_http_session_tree |
auditlog.http.session.list | auditlog.http.session | list | New |
view_auditlog_line_search |
auditlog.line.search | auditlog.log.line.view | search | New |
view_auditlog_line_tree |
view.auditlog.line.list | auditlog.log.line.view | list | New |
view_auditlog_log_form |
auditlog.log.form | auditlog.log | form | New |
view_auditlog_log_search |
auditlog.log.search | auditlog.log | search | New |
view_auditlog_log_tree |
auditlog.log.list | auditlog.log | list | New |
view_auditlog_rule_form |
auditlog.rule.form | auditlog.rule | form | New |
view_auditlog_rule_search |
auditlog.rule.search | auditlog.rule | search | New |
view_auditlog_rule_tree |
auditlog.rule.list | auditlog.rule | list | New |
HTTP endpoints (0)
No HTTP endpoints found for this module.
Models touched (7)
New fields (0)
No new fields.
Public methods (1)-
autovacuum(self, days, chunk_size=None)@api.modelDelete all logs older than ``days``. This includes: - CRUD logs (create, read, write, unlink) - HTTP requests - HTTP user sessions Called from a cron.
New fields (7)
-
display_nameCharcompute='_compute_display_name'store=True args: 'Name' -
http_session_idMany2one → auditlog.http.sessionindex=Truestring='Session' args: 'auditlog.http.session' -
log_idsOne2many → auditlog.logstring='Logs' args: 'auditlog.log', 'http_request_id' -
nameCharargs: 'Path' -
root_urlCharargs: 'Root URL' -
user_contextCharargs: 'Context' -
user_idMany2one → res.usersstring='User' args: 'res.users'
-
current_http_request(self)@api.modelCreate a log corresponding to the current HTTP request, and returns its ID. This method can be called several times during the HTTP query/response cycle, it will only log the request on the first call. If no HTTP request is available, returns `False`.
New fields (4)
-
display_nameCharcompute='_compute_display_name'store=True args: 'Name' -
http_request_idsOne2many → auditlog.http.requeststring='HTTP Requests' args: 'auditlog.http.request', 'http_session_id' -
nameCharindex=True args: 'Session ID' -
user_idMany2one → res.usersindex=Truestring='User' args: 'res.users'
-
current_http_session(self)@api.modelCreate a log corresponding to the current HTTP user session, and returns its ID. This method can be called several times during the HTTP query/response cycle, it will only log the user session on the first call. If no HTTP user session is available, returns `False`.
New fields (12)
-
http_request_idMany2one → auditlog.http.requestindex=Truestring='HTTP Request' args: 'auditlog.http.request' -
http_session_idMany2one → auditlog.http.sessionindex=Truestring='Session' args: 'auditlog.http.session' -
line_idsOne2many → auditlog.log.linestring='Fields updated' args: 'auditlog.log.line', 'log_id' -
log_typeSelectionstring='Type' args: [('full', 'Full log'), ('fast', 'Fast log')] -
methodCharsize=64 -
model_idMany2one → ir.modelindex=Trueondelete='set null'string='Model' args: 'ir.model' -
model_modelCharreadonly=Truestring='Technical Model Name' -
model_nameCharreadonly=True -
nameCharsize=64 args: 'Resource Name' -
res_idIntegerargs: 'Resource ID' -
res_idsCharargs: 'Resource IDs' -
user_idMany2one → res.usersstring='User' args: 'res.users'
-
create(self, vals_list)@api.model_create_multiInsert model_name and model_model field values upon creation. -
show_res_ids(self) -
write(self, vals)Update model_name and model_model field values to reflect model_id changes.
New fields (8)
-
field_descriptionCharreadonly=True args: 'Description' -
field_idMany2one → ir.model.fieldsindex=Trueondelete='set null' args: 'ir.model.fields' -
field_nameCharreadonly=True args: 'Technical name' -
log_idMany2one → auditlog.logindex=Trueondelete='cascade' args: 'auditlog.log' -
new_valueText -
new_value_textTextargs: 'New value Text' -
old_valueText -
old_value_textTextargs: 'Old value Text'
-
create(self, vals_list)@api.model_create_multiEnsure field_id is not empty on creation and store field_name and field_description. -
write(self, vals)Ensure field_id is set during write and update field_name and field_description values.
New fields (10)
-
http_request_idMany2one → auditlog.http.requestindex=Truestring='HTTP Request' args: 'auditlog.http.request' -
http_session_idMany2one → auditlog.http.sessionindex=Truestring='Session' args: 'auditlog.http.session' -
log_typeSelectionselection=<expr>string='Type' -
methodChar -
model_idMany2one → ir.modelargs: 'ir.model' -
model_modelChar -
model_nameChar -
nameChar -
res_idInteger -
user_idMany2one → res.usersargs: 'res.users'
No public methods.
New fields (16)
-
action_idMany2one → ir.actions.act_windowstring='Action' args: 'ir.actions.act_window' -
capture_recordBooleanhelp='In case of full logging, also log all values of records at the time of deletion.'string='Log values on deletion' -
fields_to_exclude_idsMany2many → ir.model.fieldsdomain="[('model_id', '=', model_id)]"help='Changes made to these fields are not logged.'string='Fields to Exclude' args: 'ir.model.fields' -
log_createBooleandefault=Truehelp='Select this if you want to keep track of creation on any record of the model of this rule' args: 'Log Creates' -
log_export_dataBooleandefault=Truehelp='Select this if you want to keep track of exports of the model of this rule' args: 'Log Exports' -
log_readBooleanhelp='Select this if you want to keep track of read/open on any record of the model of this rule' args: 'Log Reads' -
log_typeSelectiondefault='full'help='Full log: the previous values of updated fields are retrieved and stored on the log lines. This includes stored computed fields on the updated records that may be affected by the new values of other fields.\nFast log: only log the new values assigned through the create and write operations (less information, but it is faster).'required=Truestring='Type' args: [('full', 'Full log'), ('fast', 'Fast log')] -
log_unlinkBooleandefault=Truehelp='Select this if you want to keep track of deletion on any record of the model of this rule' args: 'Log Deletes' -
log_writeBooleandefault=Truehelp='Select this if you want to keep track of modification on any record of the model of this rule' args: 'Log Writes' -
model_idMany2one → ir.modelhelp='Select model for which you want to generate log.'index=Trueondelete='set null' args: 'ir.model', 'Model' -
model_modelCharreadonly=Truestring='Technical Model Name' -
model_nameCharreadonly=True -
nameCharrequired=True -
stateSelectiondefault='draft'required=True args: [('draft', 'Draft'), ('confirmed', 'Confirmed')] -
user_idsMany2many → res.usershelp='if no user is added then it will applicable for all users'string='Users' args: 'res.users', 'audittail_rules_users', 'user_id', 'rule_id' -
users_to_exclude_idsMany2many → res.userscontext={'active_test': False}help='Changes made by these users are not logged.'string='Users to Exclude' args: 'res.users'
-
create(self, vals_list)@api.model_create_multiUpdate the registry when a new rule is created. -
create_logs(self, uid, res_model, res_ids, method, old_values=None, new_values=None, additional_log_values=None)Create logs. `old_values` and `new_values` are dictionaries, e.g: {RES_ID: {'FIELD': VALUE, ...}} -
get_auditlog_fields(self, model)@api.modelGet the list of auditlog fields for a model By default it is all stored fields only, but you can override this. -
set_to_confirmed(self)Confirm Rule for auditing changes on model and apply shortcut to view logs on that model. -
set_to_draft(self)Reset Auditlog Rules state to draft. -
unlink(self)Set rules to draft before removing them. -
write(self, vals)Update the registry when existing rules are updated.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…