From 93fa43f9003b625ccee2042be46fb6ff370c7694 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 5 Feb 2015 14:35:29 +0100 Subject: [PATCH] [REV] 54e75b02: excessive breadth makes all falsy values disappear from lists Empty checkboxes are supposed to be displayed. Fix specifically and only in the binary field. --- addons/web/static/src/js/view_list.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 29e95ee949c..1929dfe6150 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -2235,7 +2235,7 @@ instance.web.list.Column = instance.web.Class.extend({ } if (attrs.invisible) { return ''; } - if (!(row_data[this.id] && row_data[this.id].value)) { + if (!row_data[this.id]) { return options.value_if_empty === undefined ? '' : options.value_if_empty; @@ -2304,8 +2304,12 @@ instance.web.list.Binary = instance.web.list.Column.extend({ _format: function (row_data, options) { var text = _t("Download"); var value = row_data[this.id].value; + if (!value) { + return options.value_if_empty || ''; + } + var download_url; - if (value && value.substr(0, 10).indexOf(' ') == -1) { + if (value.substr(0, 10).indexOf(' ') == -1) { download_url = "data:application/octet-stream;base64," + value; } else { download_url = instance.session.url('/web/binary/saveas', {model: options.model, field: this.id, id: options.id});