So to do this, I think I would create an app that uses a server side hook, to register an “on save” hook for ALL doc types, and when that fires, create a new instance of a DocType “AuditRecord”, with appropriate columns (entity doctype, entity id, user, time, new value).
a) Does that sounds correct, and doable, within the framework?
b) Specifically, is the hook for ALL doc type changes possible?
I thint the best place to add this is in Comments. Comment already had a “type” property and we already log events like attachment added, removed, assigned, etc.
What we can do is:
In DocType, add a property Track Changes
If that is set, always add a comment on insert and every update (also save a diff of the properties changed).
This is how comments are added on submit
You can just modify this method and add a condition to check “track_changes” and then add comment also for “Save”
If you push your code, will be happy to guide you!
Has there been any updates on this? Has anyone implemented this successfully, I’ll be happy to get any pointers. I have also raised a similar issue at Status of Audit Trail or How to Implement