Files
odoo_source/addons/website/static
Benjamin Vray 808780c89c [FIX] website: fix traceback with website form date(time) fields
Since commit [1], the "tempusdominus" date(time) picker has been
replaced by the OWL date(time) picker. A traceback appears when loading
a website form containing a field dependent on a date(time) field.

This traceback occurs because when checking the value of an empty
date(time) field (which happens when the user hasn't yet filled out the
form), we parse the field value into a Date(Time).

Before the changes in commit [1], we parsed this differently, which
didn't crash but returned "NaN" with an empty date(time) field.

In this commit, we now check whether a date(time) is valid and if not,
we now assign it "NaN" to maintain exactly the same behaviour as before
the commit [1]. Any value other than "NaN" would not work with the date
comparison system and would break certain conditions.

This commit also adds steps to the "website_form_editor" test tour so
that it fails without this commit.

[1]: https://github.com/odoo/odoo/commit/910897fc97d87b08f01627094ec8c159f5267628

task-3790809

closes odoo/odoo#158288

Signed-off-by: Robin Lejeune (role) <role@odoo.com>
2024-03-28 16:04:46 +00:00
..