-
Notifications
You must be signed in to change notification settings - Fork 69
[FIX] pivot: Ensure computed measure range adaptation #7564
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
Closed
Conversation
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
Task: 5358213 X-original-commit: 5b37123
Currently, ODOO pivots computed measures are not properly updated upon sheet structure modification. To be precise, their definition, which is stored in the core plugin `PivotCorePlugin` is properly updated but the runtime definition, stored in `PivotUIPlugin`, is not. This occurs because the mecanism to invalidate the runtime definition explicitely ignores the ODOO pivots. histoically, this was set up to avoid useless reloading of ODOO pivots which could end up making server calls but this logic is properly handled in the function `onDefinitionChange`. We can see that in the case of spreadsheet pivots, we already notify all plugins of such a change, but by "pure accident", as we dispatch an "UPDATE_PIVOT" command at every range adaptation, regardless of whether it was necessary or not. This means that the spreadsheet pivots beneficiated of two mecanisms to update their runtime (in core, an UPDATE_PIVOT, and the `invalidateEvaluationCommands` mecanism) which means that invalidation work was done two times. The investigation also led to the discovery of a missing check on the command "ADD_PIVOT" which has been reported in https://www.odoo.com/odoo/2328/tasks/5360591 We also noted that there is a double handling of commands between the handling of `invalidateEvaluationCommands` and the specific command handlers in `PivotUIPlugin`. We could clean this up in master. Note that additional tests regarding the Odoo pivots will be added in Odoo repository to ensure the validity of the fix. Task: 5358213 X-original-commit: 246af93
Collaborator
Collaborator
Author
|
This PR targets saas-18.3 and is part of the forward-port chain. Further PRs will be created up to master. More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
Collaborator
Author
|
@rrahir @LucasLefevre child PR #7565 has become a normal PR because head updated from be1e0a1 to a584bfb. This PR (and any of its parents) will need to be merged independently as approvals won't cross. |
Collaborator
|
robodoo r+ |
robodoo
pushed a commit
that referenced
this pull request
Nov 28, 2025
Task: 5358213 X-original-commit: 5b37123 Part-of: #7564 Signed-off-by: Lucas Lefèvre (lul) <[email protected]> Signed-off-by: Rémi Rahir (rar) <[email protected]>
robodoo
pushed a commit
that referenced
this pull request
Nov 28, 2025
Currently, ODOO pivots computed measures are not properly updated upon sheet structure modification. To be precise, their definition, which is stored in the core plugin `PivotCorePlugin` is properly updated but the runtime definition, stored in `PivotUIPlugin`, is not. This occurs because the mecanism to invalidate the runtime definition explicitely ignores the ODOO pivots. histoically, this was set up to avoid useless reloading of ODOO pivots which could end up making server calls but this logic is properly handled in the function `onDefinitionChange`. We can see that in the case of spreadsheet pivots, we already notify all plugins of such a change, but by "pure accident", as we dispatch an "UPDATE_PIVOT" command at every range adaptation, regardless of whether it was necessary or not. This means that the spreadsheet pivots beneficiated of two mecanisms to update their runtime (in core, an UPDATE_PIVOT, and the `invalidateEvaluationCommands` mecanism) which means that invalidation work was done two times. The investigation also led to the discovery of a missing check on the command "ADD_PIVOT" which has been reported in https://www.odoo.com/odoo/2328/tasks/5360591 We also noted that there is a double handling of commands between the handling of `invalidateEvaluationCommands` and the specific command handlers in `PivotUIPlugin`. We could clean this up in master. Note that additional tests regarding the Odoo pivots will be added in Odoo repository to ensure the validity of the fix. closes #7564 Task: 5358213 X-original-commit: 246af93 Signed-off-by: Lucas Lefèvre (lul) <[email protected]> Signed-off-by: Rémi Rahir (rar) <[email protected]>
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.

Description:
Currently, ODOO pivots computed measures are not properly updated upon
sheet structure modification. To be precise, their definition, which is
stored in the core plugin
PivotCorePluginis properly updated but theruntime definition, stored in
PivotUIPlugin, is not.This occurs because the mecanism to invalidate the runtime definition
explicitely ignores the ODOO pivots. histoically, this was set up to
avoid useless reloading of ODOO pivots which could end up making server
calls but this logic is properly handled in the function
onDefinitionChange.We can see that in the case of spreadsheet pivots, we already
notify all plugins of such a change, but by "pure accident", as we
dispatch an "UPDATE_PIVOT" command at every range adaptation, regardless
of whether it was necessary or not. This means that the spreadsheet
pivots beneficiated of two mecanisms to update their runtime (in core,
an UPDATE_PIVOT, and the
invalidateEvaluationCommandsmecanism) whichmeans that invalidation work was done two times.
The investigation also led to the discovery of a missing check on the
command "ADD_PIVOT" which has been reported in https://www.odoo.com/odoo/2328/tasks/5360591
We also noted that there is a double handling of commands between the
handling of
invalidateEvaluationCommandsand the specific commandhandlers in
PivotUIPlugin. We could clean this up in master.Note that additional tests regarding the Odoo pivots will be added in
Odoo repository to ensure the validity of the fix.
Task: 5358213
review checklist
Forward-Port-Of: #7560
Forward-Port-Of: #7534