server-tools icon indicating copy to clipboard operation
server-tools copied to clipboard

Old values are alwasy false

Open mads-vkd opened this issue 2 years ago • 2 comments

https://github.com/OCA/server-tools/blob/4384997e76e13aa3bc15800fd611c6070dd09eab/auditlog/models/rule.py#L343

We're encountering an issue where the "old value" is always false; is that the intended logic here? It would seem it simply takes the key values from the vals dictionary and creates a dictionary where the values of each key is simply False, without populating them with the current values found on "self" prior to writing to the recordset. It has the knock-on effect of rendering the logging of any field that is edited to be False as invisible, as the code sees the old and new value as the same (False), and thus doesn't add any line to the resulting log, only showing something was edited, but not what, nor to what.

mads-vkd avatar May 30 '23 13:05 mads-vkd

@mads-vkd To me it also does not seem to be correct as the deletion of a value within a product field is not tracked properly. not sure if this issue goes into the same direction.

BT-srieskamp avatar Jul 10 '23 13:07 BT-srieskamp

I'm not sure who I should tag here as no maintainer is currently listed in the Readme for the auditlog module. If I provide a fix for this issue, will it be merged? I'm asking because it's not clear to me whether the mentioned behaviour in the code is a bug or an intentional performance optimization for the fast log mode. Who is responsible for the auditlog code? Any hints? I'd be interested in getting this fixed and would provide the code change.

BT-pgaiser avatar Aug 25 '25 12:08 BT-pgaiser