From ea1b3254bb58b762c4398dbd8a823a7a41fff6e1 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Fri, 3 May 2019 11:56:10 +0000 Subject: [IMP] web: multi-line many2one: only highlight first line Rev. a3489be33 removed this feature to fix a bug (when the single line many2one, e.g. a product, is too long and displayed over several lines). However, we (fp) still want this for res_partner many2ones with show_adress. This rev. re-introduced the feature without re-introducing the bug. closes odoo/odoo#33139 Signed-off-by: VincentSchippefilt --- addons/web/static/src/js/fields/relational_fields.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/fields/relational_fields.js') diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index 751c16b3a23..325e0ceb8e8 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -465,7 +465,10 @@ var FieldMany2One = AbstractField.extend({ * @private */ _renderReadonly: function () { - var value = _.escape((this.m2o_value || "").trim()).split("\n").join("
"); + var escapedValue = _.escape((this.m2o_value || "").trim()); + var value = escapedValue.split('\n').map(function (line) { + return '' + line + ''; + }).join('
'); this.$el.html(value); if (!this.noOpen && this.value) { this.$el.attr('href', _.str.sprintf('#id=%s&model=%s', this.value.res_id, this.field.relation)); -- cgit v1.2.3