diff options
| author | Alexandre Kühn <aku@odoo.com> | 2018-07-27 17:00:32 +0200 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2018-07-27 18:20:02 +0200 |
| commit | 66dd126053887a9c98724593012f25c8a5dd8a29 (patch) | |
| tree | 4e2f175b6b79d34281695abea898177233a90b88 /addons/web/static/src | |
| parent | 2e440ac662fbb68fe0d9020fbe91634c3fcbc62c (diff) | |
[FIX] web: empty input for empty password field
Revision on https://github.com/odoo/odoo/commit/4b3588feb2b7e260bf237b0f3944c90cdc47c3b5
In order to not replace characters with '*' in edit mode (because of `input`
with type 'password'), the above commit did not format the value at all.
The formatter of a char with the option 'isPassword' turns all of its
characters into '*'. That is not intended for password inputs, because the
content is hidden by the browser with the 'password' type.
The issue with not using the formatter is that an empty field has the value
`false`, so an empty password field produces an non-empty password input with
its value to 'false'.
This commit fixes the issue by forcing empty string for empty password values.
Note: if you use an integer field with password, falsy values (e.g. `0`) become
empty strings in the input value.
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/fields/basic_fields.js | 2 |
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 d4af202d39f..8ac3b49e90e 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -248,7 +248,7 @@ var InputField = DebouncedField.extend({ var inputVal; if (this.nodeOptions.isPassword) { inputAttrs = _.extend(inputAttrs, { type: 'password', autocomplete: 'new-password' }); - inputVal = this.value; + inputVal = this.value || ''; } else { inputAttrs = _.extend(inputAttrs, { type: 'text', autocomplete: this.attrs.autocomplete }); inputVal = this._formatValue(this.value); |
