From de31afa995eb169a92c75dbad930b917252c7f78 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Tue, 25 Oct 2011 20:50:30 +0200 Subject: [PATCH] [FIX] Password fields values are not hidden lp bug: https://launchpad.net/bugs/880804 fixed bzr revid: fme@openerp.com-20111025185030-vw69honpjoaekh2v --- addons/web/static/src/js/view_form.js | 11 +++++++++++ addons/web/static/src/xml/base.xml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index e3584c21c13..c701f21fee1 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1170,6 +1170,10 @@ openerp.web.form.Field = openerp.web.form.Widget.extend(/** @lends openerp.web.f openerp.web.form.FieldChar = openerp.web.form.Field.extend({ template: 'FieldChar', + init: function (view, node) { + this._super(view, node); + this.password = this.node.attrs.password === 'True' || this.node.attrs.password === '1'; + }, start: function() { this._super.apply(this, arguments); this.$element.find('input').change(this.on_ui_change); @@ -2858,9 +2862,16 @@ openerp.web.form.FieldReadonly = openerp.web.form.Field.extend({ }); openerp.web.form.FieldCharReadonly = openerp.web.form.FieldReadonly.extend({ template: 'FieldChar.readonly', + init: function(view, node) { + this._super(view, node); + this.password = this.node.attrs.password === 'True' || this.node.attrs.password === '1'; + }, set_value: function (value) { this._super.apply(this, arguments); var show_value = openerp.web.format_value(value, this, ''); + if (this.password) { + show_value = new Array(show_value.length + 1).join('*'); + } this.$element.find('div').text(show_value); return show_value; } diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 7e081520ffc..7b330cd8112 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -763,7 +763,7 @@

-