[17.0][FIX] auditlog: registry propagation - #3088
Merged
OCA-git-bot merged 2 commits intoOct 23, 2024
Merged
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.
gurneyalex
force-pushed
the
auditlog-fix-registry-propagation
branch
from
October 22, 2024 06:34
b7cb436 to
56d1a1e
Compare
pedrobaeza
reviewed
Oct 22, 2024
gurneyalex
force-pushed
the
auditlog-fix-registry-propagation
branch
from
October 22, 2024 06:53
20356ba to
5d2afc0
Compare
sebalix
approved these changes
Oct 22, 2024
sebalix
reviewed
Oct 22, 2024
| # 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 |
Contributor
There was a problem hiding this comment.
Is it something compatible on Odoo < 17.0 that should be backported?
Contributor
There was a problem hiding this comment.
That seems at least compatible with Odoo 16.0, didn't checked previous versions.
ivantodorovich
approved these changes
Oct 22, 2024
Contributor
|
/ocabot merge patch |
Contributor
|
On my way to merge this fine PR! |
Contributor
|
Congratulations, your PR was merged at b26d775. Thanks a lot for contributing to OCA. ❤️ |
max3903
approved these changes
Nov 17, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_automationwhich sets the the registry_invalidated field of env.registry to True to cause a full registry reload.