Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] Change display of m2o link #1041

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions web_tree_many2one_clickable/static/src/css/m2o_clickable.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.m2o_clickable a{
visibility:hidden;
}
.m2o_clickable:hover a {
visibility:visible;
}
apollet marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ListView.Column.include({
var value = row_data[this.id].value;
var name = value[1] ? value[1].split("\n")[0] : value[1];
name = _.escape(name || options.value_if_empty);
if (this.widget == 'many2one_unclickable') {
if (this.widget == 'many2one_unclickable' || !value) {
return name;
} else if (this.use_many2one_clickable) {
var values = {
Expand All @@ -65,7 +65,7 @@ ListView.Column.include({
options.value_if_empty);
}
return _.str.sprintf(
'<a class="oe_form_uri" data-many2one-clickable-model="%(model)s" data-many2one-clickable-id="%(id)s">%(name)s</a>',
'<span class="m2o_clickable">%(name)s <a class="oe_form_uri" data-many2one-clickable-model="%(model)s" data-many2one-clickable-id="%(id)s"><i class="fa fa-external-link"></i></a></span>',
values
);
}
Expand Down
1 change: 1 addition & 0 deletions web_tree_many2one_clickable/views/asset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<xpath expr="." position="inside">
<script type="text/javascript"
src="/web_tree_many2one_clickable/static/src/js/web_tree_many2one_clickable.js"/>
<link rel="stylesheet" href="/web_tree_many2one_clickable/static/src/css/m2o_clickable.css"/>
</xpath>
</template>

Expand Down