summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorOlivier Dony <odo@odoo.com>2020-08-12 18:08:09 +0000
committerOlivier Dony <odo@odoo.com>2020-08-14 23:06:24 +0000
commit61c21213b282f9182eb3ddb5a709086aff311d22 (patch)
tree3fa3468e2ef6e81706ab75c24f2f54ca1fdec611 /addons/web/static/src
parent096972de0be5af2bbdf5003904bd31b79f8f4ce1 (diff)
[IMP] web: allow password fields to force the `autocomplete` value
Follow-up on 6edb7495346119e2ceb25f5b5b5568b4b890dd86, where default `autocomplete` values were introduced as default for password fields, according to the new autofill specs. This patch allows developers to force the "autocomplete" attribute value on password fields, in case there really is a need for a value that is not `new-password` (which BTW now triggers the password generator wizard in many browsers). It is useful for example when a backend form really needs to ask the user for their current password, so the correct `autocomplete` value is `current-password`, as on the login form.
Diffstat (limited to 'addons/web/static/src')
-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 252ef70894e..3e49fdbf250 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({
var inputAttrs = { placeholder: this.attrs.placeholder || "" };
var inputVal;
if (this.nodeOptions.isPassword) {
- inputAttrs = _.extend(inputAttrs, { type: 'password', autocomplete: 'new-password' });
+ 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'});