title: How to autofill employee details when employee name is selected in odoo?
body: <p>How to get the details of employee when employee name is selected in odoo.</p>
  
  <p>I have made a many2one field relating with hr.employee. but i am not able to get the results</p>
  
  <p>.py code</p>
  
  <pre><code>class mom_person(osv.Model):
  _name = 'mom.person'
  _columns = { 
  'emp_i' : fields.many2one('hr.employee','Attendees'),
  'ename_id' : fields.many2one('mom.meeting','Attend Person'),
  'depat':fields.char('Department'),
  'wk_mail':fields.char('Mail'),
  'wk_cnt':fields.char('Contact'),
  }
  
  def get_emp_det(self, cr, uid, ids, emp_i, context=None):
  val = {}
  emp_id = self.pool.get('hr.employee')
  if emp_i:
  for rec in emp_id.browse(cr,uid,emp_i,context=context):
  val = {
  'depat': rec.department_id,
  'wk_mail':rec.work_email,
  'wk_cnt':rec.work_phone,
  }   
  return val  
  
  mom_person()
  </code></pre>
  
  <p>and xml code</p>
  
  <pre><code>&lt;tree string="Employee name" editable="bottom"&gt;
  &lt;field name="emp_i" onchange="get_emp_det(emp_i)"/&gt;
  &lt;field name="depat"/&gt;
  &lt;field name="wk_mail"/&gt;
  &lt;field name="wk_cnt"/&gt;
  &lt;/tree&gt;
  /field&gt;
  </code></pre>