-
- Downloads
[FIX] website: trigger visibility with prefilled form input
Form fields can be prefilled since [1] and their visibility conditionally linked to other fields since [2]. 1. This commit ensures prepopulated fields trigger the conditional visibility mechanism (A), including when said field is first hidden, then conditionally displayed (B). 2. Until [3], with a chain of visibility conditions, when one of them was "contains", "does not contain" or a date-related condition, a traceback was raised (C). This commit corrects the fix from [3] to prevent this behavior now that the reason has been identified. 3. Tests are also set up to enforce these fixes. Steps to reproduce (A): - Drop a form - Make field A depend on field B being set - Have field B be autopopulated from user mail - Save and check the form: A won't be shown despite B being set - Removing one letter or typing anything in the input B will trigger the visibility of A. - Expected result: B should immediately appear. Steps to reproduce (B): - Drop a form - Make field A depend on field B being set - Have field B be autopopulated and depend on field C being set - Field C is empty by default - Save: only field C is shown. Type a letter: field B appears, but not field A. - Expected result: both should appear. Note: this bug only occurs when field A is before field B. Steps to reproduce (C) (until [3]): - Drop a form - Field A depends on B containing "abc" - Field B depends on C being set - Save and type something in C: there is a traceback. task-3335536 [1]: https://github.com/odoo/odoo/commit/54873d2 [2]: https://github.com/odoo/odoo/commit/2dcbfec [3]: https://github.com/odoo/odoo/commit/2714469 closes odoo/odoo#122044 Signed-off-by:Benoit Socias (bso) <bso@odoo.com>
Loading