Skip to content

Conversation

@fw-bot
Copy link
Collaborator

@fw-bot fw-bot commented Dec 11, 2025

The method adaptRange was originally designed for each plugin to update their own ranges, whithout having to manually react to the different commands that alter the sheets structure.

We have abused the system when we introduced the spreadsheet pivots to allow the modification of a pivot dataset (which is stored in PivotCorePlugin) from another entry point SpreadsheetPivotCorePlugin) by dispatching an UPDATE_PIVOT command but there are some side effects that we did not account for, the dispatched command is forwarded to EVERY other plugin. Meaning that during an adaptRange, which should only concern a specific plugin, we end up notifying a change to the whole core/coreview stack.

This revision removes the access to 'dispatch' during the handling of adaptRange so we ensure that the changes are kept locally.

Task: 5380747

Description:

description of this task, what is implemented and why it is implemented that way.

Task: TASK_ID

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: #7603

@robodoo
Copy link
Collaborator

robodoo commented Dec 11, 2025

Pull request status dashboard

@fw-bot
Copy link
Collaborator Author

fw-bot commented Dec 11, 2025

@rrahir @LucasLefevre cherrypicking of pull request #7603 failed.

stdout:

Auto-merging src/helpers/pivot/pivot_registry.ts
Auto-merging src/plugins/core/pivot.ts
Auto-merging src/plugins/core/range.ts
CONFLICT (content): Merge conflict in src/plugins/core/range.ts
Auto-merging tests/range_plugin.test.ts

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

⚠️ after resolving this conflict, you will need to merge it via @robodoo.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

The method `adaptRange` was originally designed for each plugin to
update their own ranges, whithout having to manually react to the
different commands that alter the sheets structure.

We have abused the system when we introduced the spreadsheet pivots to
allow the modification of a pivot dataset (which is stored in
PivotCorePlugin) from another entry point `SpreadsheetPivotCorePlugin`)
by dispatching an UPDATE_PIVOT command but there are some side effects
that we did not account for, the dispatched command is forwarded to
EVERY other plugin. Meaning that during an adaptRange, which should only
concern a specific plugin, we end up notifying a change to the whole
core/coreview stack.

This revision removes the access to 'dispatch' during the handling of
`adaptRange` so we ensure that the changes are kept locally.

Task: 5380747
X-original-commit: d17a974
@rrahir rrahir force-pushed the saas-18.3-18.0-prevent-dispatch-in-adapt-range-rar-483698-fw branch from 53eb6cd to d0fcaa3 Compare December 11, 2025 10:08
@rrahir
Copy link
Collaborator

rrahir commented Dec 11, 2025

robodoo r+

robodoo pushed a commit that referenced this pull request Dec 11, 2025
The method `adaptRange` was originally designed for each plugin to
update their own ranges, whithout having to manually react to the
different commands that alter the sheets structure.

We have abused the system when we introduced the spreadsheet pivots to
allow the modification of a pivot dataset (which is stored in
PivotCorePlugin) from another entry point `SpreadsheetPivotCorePlugin`)
by dispatching an UPDATE_PIVOT command but there are some side effects
that we did not account for, the dispatched command is forwarded to
EVERY other plugin. Meaning that during an adaptRange, which should only
concern a specific plugin, we end up notifying a change to the whole
core/coreview stack.

This revision removes the access to 'dispatch' during the handling of
`adaptRange` so we ensure that the changes are kept locally.

closes #7630

Task: 5380747
X-original-commit: d17a974
Signed-off-by: Lucas Lefèvre (lul) <[email protected]>
Signed-off-by: Rémi Rahir (rar) <[email protected]>
@robodoo robodoo closed this Dec 11, 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