diff options
| author | Aaron Bohy <aab@odoo.com> | 2019-05-03 11:56:10 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2019-05-03 12:00:34 +0000 |
| commit | ea1b3254bb58b762c4398dbd8a823a7a41fff6e1 (patch) | |
| tree | 095acd989350dd4b8e05be2f6cb382c32a3b37f8 /addons/web/static/src | |
| parent | e335d235f6465bcf6869254049d73237f5c6b290 (diff) | |
[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 <VincentSchippefilt@users.noreply.github.com>
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/fields/relational_fields.js | 5 | ||||
| -rw-r--r-- | addons/web/static/src/scss/form_view.scss | 10 |
2 files changed, 10 insertions, 5 deletions
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("<br/>"); + var escapedValue = _.escape((this.m2o_value || "").trim()); + var value = escapedValue.split('\n').map(function (line) { + return '<span>' + line + '</span>'; + }).join('<br/>'); 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)); diff --git a/addons/web/static/src/scss/form_view.scss b/addons/web/static/src/scss/form_view.scss index 8bcaba31ee3..8d4f56624ca 100644 --- a/addons/web/static/src/scss/form_view.scss +++ b/addons/web/static/src/scss/form_view.scss @@ -81,10 +81,12 @@ .o_form_uri { display: inline-block; - color: $link-color; - - &:hover { - color: darken($link-color, 15%); + color: $o-main-text-color; + > span:first-child { + color: $link-color; + &:hover { + color: darken($link-color, 15%); + } } } |
