odoo/o-spreadsheet#1370

Created by fw-bot
label
odoo:saas-15.1-15.0-fix-cell-reset-on-composition-rar-hWDZ-fw
head
e53e25312037f3cbc999f9344ef2b790888d4b11
target
saas-15.1 (inactive)
merged
2 years ago by BI, Pierre Rousseau (pro)
forward-port of
odoo/o-spreadsheet#1369

[FW][FIX] edition: do not reset selection when range selecting on differe…

…nt sheet

When starting a ranger selection in the composer, we would
systematically reset the selection anchor to the cell that we were
editing in the first place. This behaviour is required when a user edits
a formula and wants to select some ranges by moving the position with
their keyboard.

e.g. User wants to sum several range together -
they start editing cell A1
select a first cell anywhere on the grid,
input a comma to add another zone,
hit ArrowDown,
it should select A2.

Unfortunately, when selecting a range on another sheet, this behaviour
does not make sense anymore since there is no guarantee that the anchor
coordinates of the edited cell existes on another sheet.

e.g. Edit on A1000 sheet 1 with 1000 rows, then move to sheet 2 with 10
rows, When selecting several ranges for a formula, you cannot be 'moved'
to A1000 since it doesn't exist.

To solve this, we choose to prevent the reset of the anchor when the
current sheet differs from the sheet of the edited cell.

task 2859417

## Description:

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

Odoo task ID : [TASK_ID](https://www.odoo.com/web#id=TASK_ID&action=333&active_id=2328&model=project.task&view_type=form&cids=1&menu_id=4720)

## 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 (\_lt("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: odoo/o-spreadsheet#1369