-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[17.0] [FIX] auditlog: Dismiss logging when not needed. #3137
Conversation
c3ef867
to
dbb4207
Compare
b2c8180
to
48bed54
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is literally a ticket in one of my backlogs 😃
The module name is included in the PR title, but not in the commit message. Can you add it there as well? And strictly speaking, [MOD]
is not a valid tag listed in https://www.odoo.com/documentation/16.0/contributing/development/git_guidelines.html#tag-and-module-name. I think this counts as a [FIX]
. Please update the commit message on that point as well.
Do you think you can include a small test so that we can rule out a regression in the future?
688cdfd
to
151c7ac
Compare
151c7ac
to
cbf5478
Compare
cbf5478
to
23bb199
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR has the |
/ocabot merge patch |
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at 0bf5429. Thanks a lot for contributing to OCA. ❤️ |
In OCA#3137 it is prevented to create auditlogs without log lines. In this particular test, it is tested that no log line is created for excluded fields. We would expect therefore that no auditlog is created after OCA#3137, but depending on the setup, an log line may be created for field phone_sanitized which is not an excluded field in the test. To fix this, the test is adapted to write another, non excluded field so that the auditlog is created in any case.
In OCA#3137 it is prevented to create auditlogs without log lines. In this particular test, it is tested that no log line is created for excluded fields. We would expect therefore that no auditlog is created after OCA#3137, but depending on the setup, an log line may be created for field phone_sanitized which is not an excluded field in the test. To fix this, the test is adapted to write another, non excluded field so that the auditlog is created in any case.
When fast logging is enabled on the audit log rules, empty records are created when fields are excluded from the list.
This results in a lot of empty unneeded log records, without any details.
This PR solves the issue so only a log record is created when needed.