title: Display fields.function on tree view odoo
body: <p>I need to display values from one2many field in tree view, so I decided to create functional field and declared it on my xml tree view:</p>
  
  <pre><code>def get_product_brands(self, cr, uid, ids, fields, arg, context):
      res={}
      for record in self.browse(cr, uid, ids, context=None).application_data_product_template_ids:
          brands = record.brand.name or ''
      print brands
      res[record.id] = brands
      return res
  </code></pre>
  
  <p>and my field declaration:</p>
  
  <pre><code>'brands' : fields.function(get_product_brands, method=True, string="Product brands", type='char', store=True)
  </code></pre>
  
  <p>xml sample code:</p>
  
  <pre><code>&lt;record model="ir.ui.view" id="product_tree_inherit"&gt;
      &lt;field name="name"&gt;product.tree.inherit&lt;/field&gt;
      &lt;field name="model"&gt;product.template&lt;/field&gt;
      &lt;field name="inherit_id" ref="product.product_template_tree_view"/&gt;
      &lt;field name="arch" type="xml"&gt;
           &lt;xpath expr="//field[@name='categ_id']" position="after"&gt; 
               &lt;field name="brands"/&gt;
           &lt;/xpath&gt;
      &lt;/field&gt;
  &lt;/record&gt;
  </code></pre>
  
  <p>In my console, I can see correct records printed but I does not display anything in my tree view.</p>
  
  <p>Can anyone help me?</p>