From 0cbb2e8257d99d309f1361f6117289e330ba7603 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 28 Jun 2012 14:36:21 +0200 Subject: [PATCH] [IMP] m2o only show first line bzr revid: nicolas.vanhoren@openerp.com-20120628123621-nt7uo6e2he83w27n --- addons/web/static/src/js/view_form.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 9315e08871a..6b8c607477b 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2453,7 +2453,7 @@ instance.web.form.CompletionFieldMixin = { // possible selections for the m2o var values = _.map(data, function(x) { return { - label: _.str.escapeHTML(x[1]), + label: _.str.escapeHTML(x[1].split("\n")[0]), value:x[1], name:x[1], id:x[0] @@ -2720,9 +2720,9 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc display_string: function(str) { var self = this; if (!this.get("effective_readonly")) { - this.$input.val(str); + this.$input.val(str.split("\n")[0]); } else { - str = _.escape(str).replace("\n", "
"); + str = _.escape(str).split("\n").join("
"); this.$element.find('a') .unbind('click') .html(str)