diff --git a/web_tree_many2one_clickable/static/src/css/web_tree_many2one_clickable.scss b/web_tree_many2one_clickable/static/src/css/web_tree_many2one_clickable.scss
index 720183aeb..cf1240313 100644
--- a/web_tree_many2one_clickable/static/src/css/web_tree_many2one_clickable.scss
+++ b/web_tree_many2one_clickable/static/src/css/web_tree_many2one_clickable.scss
@@ -1,14 +1,7 @@
td.o_many2one_cell {
- a {
- color: $o-main-text-color !important;
- &:hover {
- color: $o-main-text-color !important;
- }
-
- .many2one_clickable {
- margin-left: 0.5em;
- visibility: hidden;
- }
+ .many2one_clickable {
+ margin-left: 0.5em;
+ visibility: hidden;
}
&:hover a.many2one_clickable {
diff --git a/web_tree_many2one_clickable/static/src/js/web_tree_many2one_clickable.js b/web_tree_many2one_clickable/static/src/js/web_tree_many2one_clickable.js
index b201901b3..a1c8269be 100644
--- a/web_tree_many2one_clickable/static/src/js/web_tree_many2one_clickable.js
+++ b/web_tree_many2one_clickable/static/src/js/web_tree_many2one_clickable.js
@@ -32,11 +32,13 @@ odoo.define('web_tree_many2one_clickable.many2one_clickable', function (require)
var self = this;
if (!this.noOpen && this.value) {
- // Disable 'click' events
- this.$el.off('click');
- this.$el.on('click', function (ev) {
- ev.preventDefault();
- })
+ // Replace '' element
+ this.$el.removeClass("o_form_uri");
+ this.$el = $("", {
+ html: this.$el.html(),
+ class: this.$el.attr("class") + " o_field_text",
+ name: this.$el.attr("name"),
+ });
// Append button
var $a = $('', {
@@ -59,5 +61,12 @@ odoo.define('web_tree_many2one_clickable.many2one_clickable', function (require)
this.$el.append($a);
}
},
+
+ getFocusableElement: function () {
+ if (this.mode === 'readonly') {
+ return $('');
+ }
+ return this._super.apply(this, arguments);
+ },
});
});