summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/basic_fields.js
diff options
context:
space:
mode:
authorMartin Geubelle <mge@odoo.com>2017-05-30 11:28:05 +0200
committerMartin Geubelle <mge@odoo.com>2017-05-31 14:10:13 +0200
commite116a69f25d3d3dcfa9ee12b34c33d9c3658bb46 (patch)
tree268662d9d6d368f512fbf1a41946ad494ade9ad4 /addons/web/static/src/js/fields/basic_fields.js
parente3fdce964357a0bf38b3925637da2ed712e8e315 (diff)
[FIX] web: properly handle autocomplete attribute
With the new views, the attribute autocomplete on input was no longer supported. We simply reintroduce its support in this commit. The basic attribute values are 'on' and 'off' but one may want to use a random string. Note that an input with type='password' is a special case: the autocomplete attribute should always be set to 'new-password' to remove autocompletion (autocomplete='off' doesn't actually remove the autocompletion).
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
-rw-r--r--addons/web/static/src/js/fields/basic_fields.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js
index cdaed1d7b4f..a5ceba50d3f 100644
--- a/addons/web/static/src/js/fields/basic_fields.js
+++ b/addons/web/static/src/js/fields/basic_fields.js
@@ -225,6 +225,9 @@ var InputField = DebouncedField.extend({
this.$input.attr({
type: this.nodeOptions.isPassword ? 'password' : 'text',
placeholder: this.attrs.placeholder || "",
+ autocomplete: this.nodeOptions.isPassword ?
+ 'new-password' :
+ this.attrs.autocomplete,
});
this.$input.val(this._formatValue(this.value));
return this.$input;