Alexandre Pollet
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
12 additions and
3 deletions
-
web_tree_many2one_clickable/README.rst
-
web_tree_many2one_clickable/__manifest__.py
-
web_tree_many2one_clickable/static/src/css/m2o_clickable.css
-
web_tree_many2one_clickable/static/src/js/web_tree_many2one_clickable.js
-
web_tree_many2one_clickable/views/asset.xml
|
|
@ -63,6 +63,7 @@ Contributors |
|
|
|
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com> |
|
|
|
* Antonio Espinosa <antonio.espinosa@tecnativa.com> |
|
|
|
* Sodexis <dev@sodexis.com> |
|
|
|
* Alexandre Pollet <alexandre.pollet@akretion.com> |
|
|
|
|
|
|
|
Maintainer |
|
|
|
---------- |
|
|
|
|
|
@ -8,7 +8,7 @@ |
|
|
|
{ |
|
|
|
"name": "Clickable many2one fields for tree views", |
|
|
|
"summary": "Open the linked resource when clicking on their name", |
|
|
|
"version": "10.0.1.0.0", |
|
|
|
"version": "10.0.1.0.1", |
|
|
|
"category": "Hidden", |
|
|
|
"website": "https://odoo-community.org/", |
|
|
|
"author": "Therp BV, " |
|
|
|
|
|
@ -0,0 +1,7 @@ |
|
|
|
.m2o_clickable a{ |
|
|
|
visibility:hidden; |
|
|
|
} |
|
|
|
|
|
|
|
.m2o_clickable:hover a { |
|
|
|
visibility:visible; |
|
|
|
} |
|
|
@ -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 = { |
|
|
@ -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-edit"></i></a></span>', |
|
|
|
values |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
@ -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> |
|
|
|
|
|
|
|