odoo/o-spreadsheet#4121

Created by fw-bot
label
odoo:17.0-16.0-fix-remove-rows-borders-adrm-X2yY-fw
head
5cb8bd17bb115d8d57821a56e4d866e1eae990e7
target
17.0
merged
3 weeks ago by BI, Lucas Lefèvre (lul)
forward-port of
odoo/o-spreadsheet#4109

[FW][FIX] borders: wrong borders on remove rows

## Description

When removing multiple headers, the borders are not shifted correctly, leading to incorrect borders.

This happens because we modify the borders for each deleted rows separately. But we don't sort the rows before modifying the borders. So we first delete the row 1, then the row 2. But the row 2 is now the row 1, since the old row 1 has been deleted. So we end up with wrong operations.

This is solved by simply sorting the rows in reverse order before modifying the borders.

Task: : [3884112](https://www.odoo.com/web#id=3884112&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 (\_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: odoo/o-spreadsheet#4119
Forward-Port-Of: odoo/o-spreadsheet#4109