summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields
diff options
context:
space:
mode:
authorMathieu Duckerts-Antoine <dam@odoo.com>2019-10-03 15:13:21 +0000
committerMathieu Duckerts-Antoine <dam@odoo.com>2019-10-07 08:40:53 +0000
commit64293fbdb0a247f689c1b0b0c580d9ce577af510 (patch)
treebe34d9850c8236d44406d4d0d841e757b4407583 /addons/web/static/src/js/fields
parent2b8f5dce061269bca48aad5a54e0f8fa767fe17d (diff)
[FIX] web: prevent browsers inputs autofill
We don't want the browser to fill inputs in the backend. Most of the time this is useless but sometimes it is even problematic. For example, focusing an input in a modal can trigger autofill not only in the modal but also in the whole page. If there is an input outside the modal and it is recognized by the browser as a candidate to fill, bad things occur. For that reason, we set the attribute autocomplete to "none" by default for input elements. Note that "off" does not work all the time because the browsers sometimes decide to ignore it. Task ID: 2076730 closes odoo/odoo#38039 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Diffstat (limited to 'addons/web/static/src/js/fields')
-rw-r--r--addons/web/static/src/js/fields/basic_fields.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js
index 4590f490932..c21443eba3b 100644
--- a/addons/web/static/src/js/fields/basic_fields.js
+++ b/addons/web/static/src/js/fields/basic_fields.js
@@ -262,7 +262,7 @@ var InputField = DebouncedField.extend({
inputAttrs = _.extend(inputAttrs, { type: 'password', autocomplete: 'new-password' });
inputVal = this.value || '';
} else {
- inputAttrs = _.extend(inputAttrs, { type: 'text', autocomplete: this.attrs.autocomplete });
+ inputAttrs = _.extend(inputAttrs, { type: 'text', autocomplete: this.attrs.autocomplete || 'none'});
inputVal = this._formatValue(this.value);
}