[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
e6d4ab84da 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) <tde@openerp.com>
This commit is contained in:
Mohammed Shekha
2019-08-13 12:07:34 +00:00
committed by Thibault Delavallée
parent 20efea970a
commit d4de4cd94a
+3
View File
@@ -222,6 +222,9 @@ if(!the_form.length) {
allowInputToggle: true,
keyBinds: null,
});
$('#' + date_field.id).on('error.datetimepicker', function () {
return false;
});
});
// Launch prefilling
prefill();