From d9f2eafdf2e17d382a63b74c9906d804df582f62 Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Wed, 24 Mar 2021 06:22:55 +0000 Subject: [PATCH] [FIX] web: disale autofill on input elements with this commit we disables autofill of autocomplete by setting autocomplete=off, this was previously done in commit: 64293fbdb0a247f689c1b0b0c580d9ce577af510 but it was not working because we were setting autocomplete=none it seems that none does not work all the time. task-2462676 closes odoo/odoo#71016 X-original-commit: 9d6ef842902e9e192924fa0caba99514e1543352 Signed-off-by: Aaron Bohy (aab) --- addons/web/static/src/js/fields/basic_fields.js | 2 +- addons/web/static/tests/views/form_tests.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 8a5c8a4e902..be474ace3ef 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -285,7 +285,7 @@ var InputField = DebouncedField.extend({ inputAttrs = _.extend(inputAttrs, { type: 'password', autocomplete: this.attrs.autocomplete || 'new-password' }); inputVal = this.value || ''; } else { - inputAttrs = _.extend(inputAttrs, { type: 'text', autocomplete: this.attrs.autocomplete || 'none'}); + inputAttrs = _.extend(inputAttrs, { type: 'text', autocomplete: this.attrs.autocomplete || 'off'}); inputVal = this._formatValue(this.value); } diff --git a/addons/web/static/tests/views/form_tests.js b/addons/web/static/tests/views/form_tests.js index 5023ed62e77..a3bd5025c99 100644 --- a/addons/web/static/tests/views/form_tests.js +++ b/addons/web/static/tests/views/form_tests.js @@ -7398,7 +7398,7 @@ QUnit.module('Views', { }); await testUtils.form.clickEdit(form); - assert.hasAttrValue(form.$('input[name="display_name"]'), 'autocomplete', 'none', + assert.hasAttrValue(form.$('input[name="display_name"]'), 'autocomplete', 'off', "attribute autocomplete should be set to none by default"); form.destroy(); });