From d4de4cd94aa5fe77490d93f5397fa62e697ac945 Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Fri, 9 Aug 2019 12:59:02 +0000 Subject: [PATCH] [FIX] survey: handle error.datetimepicker in survey's datetimepicker Purpose of this commit is to handle error.datetimepicker event of datetimepicker element. If not handled then window.onerror will handle it and give unexpected warning via crashmanager. Note that this issue comes from commit e6d4ab84da7a1031ab552b4a6b3fc4aa2348163e which binds window.onerror in frontend also and hence uncaught javascript error is also handled by it. As we do not want to raise crashmanager if user enters wrong value in datetimepicker let us handle it in survey.js correctly. Task 2044512 Also see https://github.com/odoo/odoo/pull/32132 closes odoo/odoo#35609 Signed-off-by: Thibault Delavallee (tde) --- addons/survey/static/src/js/survey.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/survey/static/src/js/survey.js b/addons/survey/static/src/js/survey.js index d232c3073f7..d7092902f34 100644 --- a/addons/survey/static/src/js/survey.js +++ b/addons/survey/static/src/js/survey.js @@ -222,6 +222,9 @@ if(!the_form.length) { allowInputToggle: true, keyBinds: null, }); + $('#' + date_field.id).on('error.datetimepicker', function () { + return false; + }); }); // Launch prefilling prefill();