odoo / o-spreadsheet

Other
193 stars 44 forks source link

[IMP] CF: Capture invalid formula for cellIsRule #4598

Closed rrahir closed 2 months ago

rrahir commented 3 months ago

A user could input an invalid formula in for "cellIsRule" type of conditional formats. Up until recently, this did not pause any problem because the evaluation of cf was wrapped in a try catch and we would simply ignore the faulty formulas. Unfortunately, following https://github.com/odoo/o-spreadsheet/pull/3380, the try/catch was removed and the faulty CF would throw an error during its evaluation.

This commit reinstates the try-catch in case another part of the evaluation could throw in the future so that the end user would not see their spreadsheet chrash entirely and become unable to use it themselves.

It also adds a new condition to the CF allow dispatch to capture invalid formula in order to warn the user during the CF edition in the same way we already handle invalid formulas for colorScale and Iconset rules.

Task: 4036921

Description:

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

Task: : TASK_ID

review checklist

robodoo commented 3 months ago

Pull request status dashboard

hokolomopo commented 2 months ago

Following lul PR https://github.com/odoo/o-spreadsheet/pull/4652 , this PR is obsolete no ?

rrahir commented 2 months ago

Following lul PR https://github.com/odoo/o-spreadsheet/pull/4652 , this PR is obsolete no ?

It's not. This PR aims to improve the UX by capturing invalid formulas and warning the user directly in the sidepanel. It is however outdated since the PR you mention ^^