summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2013-06-06 11:13:25 +0200
committerXavier Morel <xmo@openerp.com>2013-06-06 11:13:25 +0200
commitb45fc9bb82dd8a1bf0fea1848b69a9deb22cdfdc (patch)
tree52c46698267932aee7bb317b926fbd6f8aec99c8 /addons
parent1f96789be685376c14586c1f8d2dc4289dc356f9 (diff)
[FIX] correctly display char[password] as stars in list views
lp bug: https://launchpad.net/bugs/1113419 fixed bzr revid: xmo@openerp.com-20130606091325-q2wgizk8yq4xkgj6
Diffstat (limited to 'addons')
-rw-r--r--addons/web/static/src/js/view_list.js22
1 files changed, 19 insertions, 3 deletions
diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js
index b69ec6dbdca..840effa9221 100644
--- a/addons/web/static/src/js/view_list.js
+++ b/addons/web/static/src/js/view_list.js
@@ -578,7 +578,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
this.no_leaf = !!context['group_by_no_leaf'];
this.grouped = !!group_by;
- return this.load_view(context).then(
+ return this.alive(this.load_view(context)).then(
this.proxy('reload_content'));
},
/**
@@ -895,8 +895,9 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
this.record_callbacks = {
'remove': function (event, record) {
- var $row = self.$current.children(
- '[data-id=' + record.get('id') + ']');
+ var id = record.get('id');
+ self.dataset.remove_ids([id])
+ var $row = self.$current.children('[data-id=' + id + ']');
var index = $row.data('index');
$row.remove();
},
@@ -2060,6 +2061,7 @@ instance.web.list.columns = new instance.web.Registry({
'field': 'instance.web.list.Column',
'field.boolean': 'instance.web.list.Boolean',
'field.binary': 'instance.web.list.Binary',
+ 'field.char': 'instance.web.list.Char',
'field.progressbar': 'instance.web.list.ProgressBar',
'field.handle': 'instance.web.list.Handle',
'button': 'instance.web.list.Button',
@@ -2228,6 +2230,20 @@ instance.web.list.Binary = instance.web.list.Column.extend({
});
}
});
+instance.web.list.Char = instance.web.list.Column.extend({
+ replacement: '*',
+ /**
+ * If password field, only display replacement characters (if value is
+ * non-empty)
+ */
+ _format: function (row_data, options) {
+ var value = row_data[this.id].value;
+ if (value && this.password === 'True') {
+ return value.replace(/[\s\S]/g, _.escape(this.replacement))
+ }
+ return this._super(row_data, options);
+ }
+});
instance.web.list.ProgressBar = instance.web.list.Column.extend({
/**
* Return a formatted progress bar display