odoo/o-spreadsheet#4597

Created by BI, Rémi Rahir (rar)
Merged at e455ac0854dbde8cf296cba772c36fa2d5e3b0fb

Statuses:

label
odoo:17.0-fix-cf-eval-rar
head
90782e4eec701c2240b42226b1f0c3f0cf0ea47a
merged
3 months ago by BI, Lucas Lefèvre (lul)
odoo/o-spreadsheet
17.0 #4597

[FIX] CF: Ignore errors thrown during CF evaluation

How to reproduce:
- Add a CF of type "single color"
- Input an invalid formula as its value
- save the CF

-> the whole grid crashes

Historically, the CF evaluation was wrapped in a try-catch statement and it was removed #3380 as it seemed unnecessary. Unfortunately, since there is no check on the formula validity when we create the CF, the call to compile can crash.

A future improvement (targetting master) will align the behaviour of "cellIsRule" with the other CF type ("ColorScaleRule" and "IconSetRule") and catch invalid formulas in the allowDispatch.

task-4036921

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

  1. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option#styling_with_css ↩↩↩