odoo/o-spreadsheet#7633

Created by fw-bot
Merged at f8677dcaf22085ec41e9359c093bf91a76d4d15c

Statuses:

label
odoo:master-18.0-prevent-dispatch-in-adapt-range-rar-483721-fw
head
e5a276020d1e68f97b21c9697938a2d1a1b3972a
merged
3 days ago by BI, Rémi Rahir (rar)
odoo/o-spreadsheet
18.0 #7603
saas-18.2 #7629
saas-18.3 #7630
saas-18.4 #7631
19.0 #7632
master #7633

[FIX] CorePlugins: Prevent dispatch during adaptRange

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: #7632
Forward-Port-Of: #7603