Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
Discuss (mail)
|
Lines of code | 297 |
Technical Name |
pv_track_fields_dynamic |
License | LGPL-3 |
Dynamic Field Tracking
Configure which fields on any model should be tracked. Changes are posted to the chatter in a single note per write using the native “old → new” style. No bridge modules or code changes to business models.
What it does
- Select a model and the stored (non-binary) fields you want to track.
- On create/write, posts one grouped message per record with each change as “Old → New”.
- Smart rendering for many2one, many2many/one2many, date/datetime, monetary, selection, boolean.
How it works
- Lightweight global hook around ORM create()/write().
- Only activates for models that have chatter (inherit
mail.thread
). - Per-company rule from
track.fields.config
, cached during the request. - Skips during install/upgrade; safe on registry build.
Why it’s safe
- No schema changes to business models.
- Posts as the current user for an accurate audit trail.
- Configs are linked to
ir.model
withondelete="cascade"
; uninstalling the model removes its rules.
Setup
- Install the module.
- Go to Settings → Administration → Dynamic Tracking → Configurations.
- Create a rule: pick Company, Model and Fields; optionally group messages and choose to show old/new.
- Edit a tracked field on a record with chatter and see “Old → New”.
Notes
- Binary fields are excluded by design.
- Models without chatter are skipped (no errors).
- Many2many/one2many show the full new set. A delta view (+Added/–Removed) can be added if needed.
Compatibility
- Odoo 18.
Screenshot
Configuration form with example tracked fields:
License: LGPL-3
Please log in to comment on this module