3
0
Fork 0

Merge pull request #302 from schout-it/7.0

[FIX] undefined links if field is not set
7.0
Pedro M. Baeza 2016-04-01 11:15:03 +02:00
commit 0a6fc8e0b6
1 changed files with 7 additions and 4 deletions

View File

@ -26,11 +26,14 @@ openerp.web_tree_many2one_clickable = function(openerp)
'instance.web_tree_many2one_clickable.Many2OneClickable');
openerp.web_tree_many2one_clickable.Many2OneClickable = openerp.web.list.Column.extend({
_format: function (row_data, options)
{
if (row_data[this.id].value)
{
return _.str.sprintf('<a class="oe_form_uri" data-many2one-clickable-model="%s" data-many2one-clickable-id="%s">%s</a>',
this.relation,
row_data[this.id].value[0],
_.escape(row_data[this.id].value[1] || options.value_if_empty));
}
},
});