title: How to use selection on many2one field
body: <p>As described <a href="https://doc.openerp.com/6.0/developer/2_5_Objects_Fields_Methods/field_type/#relational-types" rel="nofollow">here</a>, I have created a <code>many2one</code> field with custom selection function:</p>
  
  <pre><code>def _get_partner_sup(self, cr, uid, context=None):
      obj = self.pool.get('res.partner')
      ids = obj.search(cr, uid, [('supplier','=',True), ('is_company','=',True)])
      res = obj.read(cr, uid, ids, ['name', 'id','email'], context)
      res = [(r['id'], r['name']) for r in res]     
      return res
  
  _columns = {
      'partner_sup_id': fields.many2one('res.partner', 'Select Supplier 2 ', selection=_get_partner_sup),
  }
  </code></pre>
  
  <p>But it's still like a normal <code>many2one</code> field.</p>