Odoo, show records for common class

0

I have two classes:

class UYNominaFormFamilia(models.Model):
_name = "uy_nomina.formfamilia

 familiares_ids =fields.One2many('hr.employee.familiar','form_familia_id')
 employee_id = fields.Many2one('hr.employee', 'Empleado')

and

class hr_employee(models.Model):
_inherit = "hr.employee"

familiares_ids =fields.One2many('hr.employee.familiar','form_familia_id')

As you can see, both classes are related to hr.employee.familiar, they have in common that both have the id of the employee. What I want to achieve, is that if I consult from any of the classes, show me the same family members.

I tried to force the ids when creating, but it does not work, it is not valid to redefine the write to insert the relatives because, it is the same class and it does not interest me to duplicate the relatives if they are exactly the same data.

Any ideas?

    
asked by Luis Contreras 09.11.2018 в 20:02
source

0 answers