o-spreadsheet
o-spreadsheet copied to clipboard
[FIX] pivot: Prevent faulty pivot domain to crash
The getter getPivotCellFromPosition
parses pivot cells domain args but this step assumes that the domain is valid (e.g. refers to a valid groupby,measure combination). Unfortunately, if the domain is invalid, the parsing will crash.
Similarly to the decision made for the getter evaluateFormula
[^1] we wrap the parsing in a try/catch statement and in case of faulty evaluation, return the same result as for invalid/non-existing pivots, that is an empty Pivotcell.
[^1]: See https://github.com/odoo/o-spreadsheet/pull/3371
Task: 4088765
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