From bbf724e4012e983d56bea27b66caa204294ebda6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Mon, 29 May 2017 11:22:26 +0200 Subject: [FIX] web: properly support password attribute for fields With the new views, the special attribute password was no longer supported. We simply reintroduce in this commit proper support to display password fields with *. Note: we may want to display passwords with a static number of *, but this requires some thoughts on the usability of the change. We simply reintroduce the previous behaviour here. --- addons/web/static/src/js/fields/basic_fields.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index 3f279eeeec7..cdaed1d7b4f 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -165,6 +165,7 @@ var InputField = DebouncedField.extend({ */ init: function () { this._super.apply(this, arguments); + this.nodeOptions.isPassword = 'password' in this.attrs; if (this.mode === 'edit') { this.tagName = 'input'; } @@ -222,7 +223,7 @@ var InputField = DebouncedField.extend({ this.$input = $input || $(""); this.$input.addClass('o_input'); this.$input.attr({ - type: 'text', + type: this.nodeOptions.isPassword ? 'password' : 'text', placeholder: this.attrs.placeholder || "", }); this.$input.val(this._formatValue(this.value)); -- cgit v1.2.3