[FIX] website_form: fix form values reset on Firefox

Reseting the field should just be done through the form element's reset
method to let the browser do it properly, otherwise the browser may
validate the applied values (and for example mark the required field
as wrong (making them red)).

task-2312878

closes odoo/odoo#61200

X-original-commit: 7676fc069d8b6458d0fc1f8eafe087ce553743f0
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
qsm-odoo
2020-11-02 16:37:27 +00:00
parent 6b404c615d
commit 265d8ce9d2
@@ -82,7 +82,7 @@ odoo.define('website_form.s_website_form', function (require) {
this.$target.find('button').off('click');
// Empty imputs
this.$target.find('input[type="text"], input[type="email"], input[type="number"], input[type="tel"], input[type="url"], textarea').val('');
this.$target[0].reset();
// Remove saving of the error colors
this.$target.find('.o_has_error').removeClass('o_has_error').find('.form-control, .custom-select').removeClass('is-invalid');