title: ValueError: Invalid field 'invoice_ids' in leaf
body: <p>I am new in <code>openerp</code>. I have created a module <code>Testbase</code> and that is inherited <code>res.partner</code> module. I get an error when I run this module. My Python file is <code>testbase.py</code> file:</p>
  
  <pre><code>from openerp.osv import fields, osv, orm
  
  
  def fnct(self, cr, uid, ids, fields, arg, context):
      total = {}
      for record in self.browse(cr,uid,ids):
          ac_obj = self.pool.get('account.invoice')
          ac_obj_id= ac_obj.search(cr, uid,[('invoice_id','=',record.invoice_id.id)], context=context)
          for rec in ac_obj.browse(cr,uid,ids,context=context):
              total += rec.total
      return total
  
  class testbase(osv.osv):
       _name = 'res.partner'
       _inherit = 'res.partner'
       _columns = {
           'points' : fields.function(fnct, method=True, string='Points',type='char', readonly = True, help="it indicates to how much points a customer earned"),
       }
  
  
  testbase()
  </code></pre>
  
  <p>When I run this code I receive the following error:</p>
  
  <pre><code>ValueError: Invalid field 'invoice_ids' in leaf "&lt;osv.ExtendedLeaf: ('invoice_ids', 'in', [browse_record(account.invoice.line, 1)]) on account_invoice (ctx: )&gt;" 
  </code></pre>