title: related field from inherited model in odoo
body: <p>i have a model that inherits <strong>res.partner</strong> model</p>
  
  <pre><code>class supplierDetails(models.Model):
      _inherit = 'res.partner'
  
     farmer_code = fields.Char(string="Farmer's Code")
  </code></pre>
  
  <p>Now i want the values from farmer_code in another model, so as per <a href="https://stackoverflow.com/a/40104725">this</a> answer, i reached this far.</p>
  
  <pre><code>class productTest(models.Model):
       _name = 'quality.physical'
       _inherit = 'res.partner'
  
  frm_code_ids = fields.Many2one('res.partner',string="Farmer Code")
      frm_cod = fields.Char(related='frm_code_ids.farmer_code',store=True,readonly=True)
  </code></pre>
  
  <p>Now i am getting <strong>KeyError: 'farmer_code'</strong>. What do i do to fix this?         Thanks in advance.</p>