odoo/o-spreadsheet#4126

Created by fw-bot
label
odoo:17.0-saas-16.4-fix-spread-self-invalidation-rar-sK5v-fw
head
09aaed190a0952905a4634b6fea9f38cfd0ee94f
target
17.0
merged
3 weeks ago by BI, Rémi Rahir (rar)
forward-port of
odoo/o-spreadsheet#4106 DETACHED (Head updated from de5c105bc1dcade684a33c7ef1f21bc764e2fa76 to 09aaed190a0952905a4634b6fea9f38cfd0ee94f)

[FW][FIX] Evaluator: Prevent incorrect invalidations

## Description:
This commit solves an issue with the invalidation process of spreaded
formulas. While marking the positions invalidated by a given position,
we would mistakenly mark the latter to be recomputed as well,
effectively creating an infinite loop (position is invalid > invalidate
its dependencies > position is invalidated > etc ...).

This issue was introduced by a bugfix in https://github.com/odoo/o-spreadsheet/pull/3125
and was not discovered as the infinite loop is actually stopped by our
maximum iteration limit.

Avoiding these useless iterations implies a performance improvement of a
factor 30 when reevaluating a spreaded formula.

Co-authored-by: Lucas Lefèvre <lul@odoo.com>

Task: 3883954

- [ ] 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#4106