odoo/o-spreadsheet#6950

Created by fw-bot
Merged at 4ec1a1dc22d8afa54eca904734dd65b1779982cd

Statuses:

label
odoo:saas-18.1-18.0-fix-table-move-columns-rows-dhrp-447955-fw
head
89fdd496366f6aafe9953a1489fa4d2c4c45f05b
merged
3 weeks ago by BI, Dhrutik Patel (dhrp)
odoo/o-spreadsheet
18.0 #6760
saas-18.1 #6950
saas-18.2 #6951
saas-18.3 #6952
saas-18.4 #6954
master #6955

[FIX] selection: prevent partial move of table rows with headers

Description:

Steps to reproduce

  • Create a table with headers
  • Select some rows including the header row, but not the whole table
  • Try to move the selected rows

Current behavior

The move is allowed even when only part of the table (including headers) is selected.
This results in broken table structure or orphaned headers.

Desired behavior after PR is merged

Row moves are allowed only if:

  • The headers are not included in the selection, or
  • The entire table (including headers) is selected.

Task: 4862731

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