Merge PR #1576 into 12.0

Signed-off-by pedrobaeza
pull/1579/head
OCA-git-bot 2020-04-14 19:43:36 +00:00
commit 00a7f28460
2 changed files with 21 additions and 15 deletions

View File

@ -1,10 +1,17 @@
td.o_many2one_cell {
a {
margin-left: 0.5em;
visibility: hidden;
}
a {
color: $o-main-text-color !important;
&:hover {
color: $o-main-text-color !important;
}
&:hover a {
visibility: visible;
}
.many2one_clickable {
margin-left: 0.5em;
visibility: hidden;
}
}
&:hover a.many2one_clickable {
visibility: visible;
}
}

View File

@ -32,19 +32,18 @@ odoo.define('web_tree_many2one_clickable.many2one_clickable', function (require)
var self = this;
if (!this.noOpen && this.value) {
// Replace '<a>' element
this.$el.removeClass('o_form_uri');
this.$el = $('<span/>', {
html: this.$el.html(),
class: this.$el.attr('class') + ' o_field_text',
name: this.$el.attr('name'),
});
// Disable 'click' events
this.$el.off('click');
this.$el.on('click', function (ev) {
ev.preventDefault();
})
// Append button
var $a = $('<a/>', {
href: '#',
class: 'o_form_uri btn btn-sm btn-secondary' +
' fa fa-angle-double-right',
' fa fa-angle-double-right many2one_clickable',
tabindex: '-1',
}).on('click', function (ev) {
ev.preventDefault();
ev.stopPropagation();