department_id = fields.Many2one('hr.department', string='Dział', required=True, track_visibility='onchange', store=True)
employee_id = fields.Many2many('hr.employee', 'department_id', index=True)
@api.depends('department_id')
@api.onchange('department_id')
def _compute_employees(self):
emp_data = self.env['hr.employee'].browse([('department_id','in',self.department_id.id)])
for department in self:
department.employee_id = emp_data
Don't work...