Document Version Controlling

@alec_ruizramon1,

Hi Alec,

I was searching in the discussion forum for help regarding audit trail and document version controlling and I hit upon this link, https://github.com/aruizramon/frappe_analytics. I installed this app and followed the instructions and was really happy to see that it was creating a record with all the old information and the new information. The perfect solution for our requirements. A really good work on this. But, just wanted to check with you a couple of things. Though, it works on the development setup, can it be deployed on the production setup of the clients? Also, currently, all the history is being saved in Doc History Temp with a random name. Can the naming not be changed to the doctype and doc number or something?

Thanks a lot for this fantastic app and hoping to hear from you.
Uma

2 Likes

Thanks for the kind words!

We have it deployed on our production setup, so it should work there as well! I believe I took care of all of the issues with installation, but that could be one potential roadblock. Iā€™d take a db backup, deploy it locally, and test install /migrate it there. If that goes smoothly, itā€™ll work in production as well.

As a side note - the way it works is as follows.

  1. User saves a document.
    a. Just before saving, a ā€˜doc history tempā€™ row is created in the database. The ā€˜old_docā€™ field gets a copy of the pre-save document as a JSON blob.
    b. Just after saving / validation, the same ā€˜doc history tempā€™ row above gets a copy of the updated doc in the ā€˜new_docā€™ field.

  2. In a background task, all of the outstanding ā€˜doc history tempā€™ rows that have old and new doc data (including if a doc was deleted, created, etc) are compared. Any fields that have changed, save a few (such as modified, for example) have a row created in that docā€™s specific history table (i.e. ā€œLead Field Historyā€).

In terms of naming - itā€™s possible to create a name such as DocType/DocName/Hash. However, the improvements of doing something like this could be accomplished by changing the ā€˜titleā€™ field of the doc could be changed to show Doctype-Docname-Field or something similar. The hash is the primarykey of the table and needs to be unique (hence the jumbled characters).

1 Like

Thanks a lot for your reply Alec. And, thanks for the response on my
queries. It works well on my laptop in the develop version but yes, will
take a backup before installing it on live.

Once again, thanks for the response. :slight_smile:

1 Like

Of course! Iā€™m glad youā€™re using it, let me know if you have any issues! Always open to feeedback :slight_smile:

Hello @alec_ruizramon1 The github link for this is no longer active. Do you happen to have this hosted somewhere I could try it?