idea: invoice change history
How big is this feature?
Small
Describe the problem
At the moment if a user changes something, apart from possibly an audit log, you can't recover it. It may be nice to have a version history of invoices when users change things. Even a table of audit logs, with the ability to "go back to" via a button.
awaiting more details, feel free to chip in!
Describe a possible solution
No response
Hello, I would like solve this issue.
Hi @tomasandrejdes,
That's fine, may I just ask that you update the issue as you do research/any reviews of the code before you start making changes?
E.g documenting a possible solution, diagrams if easier, model structure, etc.
May I also ask for an ETA when this can be started? Just helps keep it organised. Otherwise we get old issues with no progress.
Thanks!
Hi, I plan to start in the following days. I will write here with my findings and potential solutions.
Hi, I want to ask, do you have a concrete idea of how you would like it resolved? Do you want the invoice history record to be editable again? Or it is enough that the original record is only for display. Can I create a new table in the database?
Hey @tomasandrejdes,
Yeah the history should basically just store every field. Similar to "Django-simple-history"
But no libraries.
So with this it should be really easy to "go back" to an old version and replace all content.
Yeah a new model will definitely be needed. It may need dynamic fields though and if we change a field it still needs to handle old versions.
Do let me know if you have anything else, more than happy to go over it. If you have discord feel free to DM me, I'm much more active and will respond quicker there.
Thanks!
Thanks for now, I will write when I have discrepancies
Hello, if you want we can switch to discord please send me your name.
I created a new InvoiceHistory model, I store the invoice id, timestamp, record version and a JSON field that should contain all the invoice attributes.
I also modified the manage.html template, for the history overview.
In the attachment, I am sending a screen of the overview.