Skip to content

Conversation

@fw-bot
Copy link
Collaborator

@fw-bot fw-bot commented Nov 28, 2025

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 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

review checklist

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_t("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

Forward-Port-Of: #7560
Forward-Port-Of: #7534

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
@robodoo
Copy link
Collaborator

robodoo commented Nov 28, 2025

Pull request status dashboard

@fw-bot
Copy link
Collaborator Author

fw-bot commented Nov 28, 2025

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

@fw-bot
Copy link
Collaborator Author

fw-bot commented Nov 28, 2025

@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.

@rrahir
Copy link
Collaborator

rrahir commented Nov 28, 2025

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]>
@robodoo robodoo closed this Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants