diff options
| author | Christophe Simonis <chs@openerp.com> | 2012-07-18 16:32:52 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@openerp.com> | 2012-07-18 16:32:52 +0200 |
| commit | d680c7597f3c7b96498e36028bfbcc04300cfe10 (patch) | |
| tree | 2aff058221dfb459eac4d87ebeab6e46072ab92b /addons/web/static/src/js | |
| parent | 5a918cf01de012e45ac580b3fb55d010001129b7 (diff) | |
| parent | be4e0b19a8881ec6a4b7eb214205be3644509640 (diff) | |
merge upstream
bzr revid: chs@openerp.com-20120718143252-4026zfkh5hcfcpr1
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 3f389d3d41f..2e404a6bfdd 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2739,10 +2739,20 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc this.$input.val(str.split("\n")[0]); this.current_display = this.$input.val(); } else { - str = _.escape(str).split("\n").join("<br />"); + var lines = _.escape(str).split("\n"); + var link = ""; + var follow = ""; + if (! this.get_definition_options().highlight_first_line) { + link = lines.join("<br />"); + } else { + link = lines[0]; + follow = _.rest(lines).join("<br />"); + if (follow) + link += "<br />"; + } this.$element.find('a') .unbind('click') - .html(str) + .html(link) .click(function () { self.do_action({ type: 'ir.actions.act_window', @@ -2754,6 +2764,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc }); return false; }); + $(".oe_form_m2o_follow").html(follow); } }, set_value: function(value_) { |
