-
-
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: registry propagation #3088
[17.0][FIX] auditlog: registry propagation #3088
Conversation
When a new auditlog rule is added / modified / deleted, all workers need to be notified of the change. This is done through registry signaling. The previous code was not using the proper level of signaling resulting in workers not being aware of the changes and not implementing the correct auditlog rules, because they had only invalidated their cache and not reloaded the registry. We fix this by using the same signaling as implemented in `base_automation` which sets the the registry_invalidated field of env.registry to True to cause a full registry reload.
b7cb436
to
56d1a1e
Compare
20356ba
to
5d2afc0
Compare
# this code comes from `base_automation` which has a similar need | ||
if self.env.registry.ready and not self.env.context.get("import_file"): | ||
# notify other workers | ||
self.env.registry.registry_invalidated = True |
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.
Is it something compatible on Odoo < 17.0 that should be backported?
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.
That seems at least compatible with Odoo 16.0, didn't checked previous versions.
/ocabot merge patch |
On my way to merge this fine PR! |
Congratulations, your PR was merged at b26d775. Thanks a lot for contributing to OCA. ❤️ |
When a new auditlog rule is added / modified / deleted, all workers need to be notified of the change. This is done through registry signaling. The previous code was not using the proper level of signaling resulting in workers not being aware of the changes and not implementing the correct auditlog rules, because they had only invalidated their cache and not reloaded the registry.
We fix this by using the same signaling as implemented in
base_automation
which sets the the registry_invalidated field of env.registry to True to cause a full registry reload.