Odoo 18, 19 and 20 · Updated December 2026
A customer's payment terms are suddenly 90 days instead of 30. A product's cost has changed. A contact you remember is no longer in the database. Sooner or later every Odoo database owner asks the same question: who changed this, and when?
Odoo already answers part of it. To answer the rest, I built a free LGPL-3 module, Audit Trail (oao_audit_trail). Its core is a log of every creation, change and deletion on the models you choose, field by field, with the old and the new value. What it records beyond that, from login history to exports and prints, is summarised at the end.
What Odoo 20 Records by Itself
Before writing a module, it is worth knowing what is already there. In Odoo 20, without any extra module:
- Field tracking in the chatter. On models with a chatter (models that inherit
mail.thread), fields declared with thetrackingattribute post a message with the old and the new value, the user and the date. Only those fields are tracked, and only on those models. Code can switch it off with the context keystracking_disableormail_notrack, and when a record is deleted, its chatter messages are deleted with it. - Who created and who last changed a record. Almost every model has
create_uid,create_date,write_uidandwrite_date. They tell you who changed the record last, not what was changed, and every new change overwrites them. - The Audit Trail report of the Invoicing / Accounting app. With the
accountmodule installed, Review ‣ Audit Trail lists the tracked changes on journal entries, accounts, taxes, partners and companies. It is built on the same chatter tracking. The Restrictive Audit Trail setting additionally prevents tracked records from being deleted; they can only be cancelled or archived. - Sessions and devices. The device log (
res.device.log) stores, per session, the user, the IP address, the browser's user agent, the country and city, and the first and last activity. Older rows are cleaned up automatically. - Last login.
res.users.loggets a row at each login, but its automatic cleanup keeps only the latest row per user. It shows when someone last logged in, not a login history.
Two things never reach the database at all. A failed login ("Login failed for login: ... from ...") and a data export ("User ... exported ... records ...") are written only to the server's log file, at the info level. Reading them means server access, and they are gone when the log file is rotated.
So the gaps are: fields without tracking, models without a chatter, deletions, changes made with tracking switched off, and a history of logins and exports that a manager can read inside Odoo.
What the Module Does
For every creation, change and deletion of a record of an audited model, oao_audit_trail stores the user, the date, the record and, field by field, the old and the new value. The module depends only on Odoo's base and web modules, so it works on any model, with or without a chatter.
Rules: one per model
Nothing is logged until a rule exists. Under Audit Trail ‣ Configuration ‣ Rules you create one rule per model, for example Contact or Product, and choose:
- Log Creation, Log Changes and Log Deletion, each on or off;
- Excluded Fields: fields whose changes are not logged, for example a field that a scheduled action updates every night.
A rule can be archived to pause logging for its model, and its Logs button opens the logs of that model. Transient models (wizards) and the module's own models cannot get a rule.
Values as the user saw them
The values are stored as text, the way a user reads them on the form: the customer's name instead of a database id, "Yes" or "No" for a checkbox, the label of a selection instead of its technical value, and the names of the tags in a many2many field. The log stays readable even after the related record is renamed or deleted.
A change that leaves every value the same creates no log. For a creation, only the fields that received a value are listed.
Two Screens: Logs and Field Changes
Audit Trail ‣ Logs shows one line per operation: date, user, model, record and operation (Creation, Change or Deletion). Filters and groupings cover the user, the model, the operation and the date. Opening a log shows each field with its old and new value, and the Open Record button opens the record itself if it still exists.
Audit Trail ‣ Field Changes shows every changed field as its own line. This is the screen for the question "who entered this value?": search for the field and for the value itself, for example "90 Days" in the new values, and the lines show who entered it, when and on which record, newest first. You can also search by user or model and group by field, user or model.
Who Can See the Logs
The module adds two access rights under Audit Trail:
- Auditor reads the logs and the rules.
- Manager also creates and changes the rules. The administrator gets this right when the module is installed.
Logs are read-only for everyone, administrators included: no group can create, change or delete a log through the user interface or the API. The module writes them itself, with superuser rights, at the moment of the operation.
sudo and Deleted Records
Much of Odoo's own code, and of custom modules, runs with superuser rights (sudo()). sudo() lifts the access checks but keeps the user, so a change made inside such code is logged under the user who triggered it, not under a technical account.
When a record is deleted, its deletion log keeps the record's name and the last values of its logged fields. Even when the chatter is gone with the record, the Field Changes screen still shows what it contained and who deleted it.
No context key turns logging off. Chatter tracking can be skipped with a context key; the audit log cannot. The only ways to stop logging a model are to change or archive its rule, which only a Manager can do.
What Is Never Logged
An auditor must not be able to read more through the log than through the record itself. So the module never logs:
- file contents (binary fields) and one2many fields;
- fields limited to some user groups (fields declared with
groups=); - fields whose name looks like a secret: password, token, API key, TOTP, PIN and similar;
- the technical fields
create_uid,create_date,write_uidandwrite_date.
Models that hold credentials or system secrets cannot get a rule at all: system parameters, mail servers, API keys, two-factor devices, payment providers and tokens, sessions and devices, attachments and a few technical logs.
Logging has a cost: on an audited model, each change reads the logged fields before and after the write. Audit the models where the question "who changed this?" really matters, not every model in the database.
Download and Installation
The module is free under the LGPL-3 licence. For Odoo 20 it is in the app store on this site, where the download asks for a name and an e-mail address. It is also on Odoo Apps for Odoo 18, 19 and 20. As with any module, try it on a test database first.
- Unzip it into a folder in your Odoo addons path and restart Odoo.
- In the Apps menu, update the apps list and install Audit Trail.
- Give the Auditor or Manager right to the users who need it.
- Create a rule for each model you want to audit, or use Load Starter Rules.
Beyond Record Changes
Record changes answer "who changed this record?". The module also answers the next questions an administrator or auditor asks, with no extra module:
- Who logged in, and who tried to? Audit Trail ‣ Logins lists every login, failed login and logout with the IP address, the browser and the platform, so a locked account or a password-guessing attempt can be checked inside Odoo instead of in the server's log file. It needs no rule and keeps 90 days by default.
- Who took data out? Each export, import and printed report of an audited model's records adds one log with the user, the number of records and the exported fields or the report. It is switched on or off per rule.
- A person or an integration? Each log shows the source of the operation: web client, external API, scheduled action, import or server action. The source is detected on the server, not taken from the request.
- The history of this record, right here. An Audit History entry in the Actions menu of every audited model opens the logs of the open record or of the selected records. Only Auditors and Managers see it.
- A log that does not grow forever. Record logs are kept forever by default; a number of days, for all models or per rule, makes Odoo delete older logs automatically.
- Faster set-up and less noise. Load Starter Rules creates rules for common models in one click, Export / Import Rules copies the rules from a test database to production as a JSON file, and the Statistics screen shows which fields and users produce the most changes, with buttons to exclude them. A changed text or HTML field can be compared side by side.
- Rules without administrator rights. A user with the Manager right of Audit Trail can configure the rules without being an Odoo administrator.
The full feature list and the release notes are on the module's Odoo Apps page.
Sources
- Odoo 20 source, field tracking: addons/mail/models/mail_track_mixin.py and addons/mail/models/mail_thread.py
- Odoo 20 documentation, ORM API, access log fields: odoo.com/documentation
- Odoo 20 documentation, Accounting reporting, Audit trail: odoo.com/documentation
- Odoo 20 source, sessions, devices and logins: odoo/addons/base/models/res_device.py and odoo/addons/base/models/res_users.py
- Odoo 20 source, data export: addons/web/controllers/export.py
- Audit Trail on Odoo Apps, features and release notes: apps.odoo.com
Odoo is a trademark of Odoo S.A. This blog is not affiliated with Odoo S.A.