Search code examples
odooodoo-8odoo-9

How can i copy some field value from Applicant to Employee form


I have same fields Degree and tribe like below

        x_tribe = fields.Char(string="Tribe")
        x_degree = fields.Many2one('hr.recruitment.degree', string="Degree")

in Applicant and employee model. I want to copy these field values from Applicant form to Employee form, when employee is created.


Solution

  • Use Related fields. Example:

     partner_id = fields.many2one('res.partner','Partner'),
     participant_nick = fields.Char(string='Nick name',
                               related='partner_id.name')