On my module I need that when I select departments, only the employees of selected departments appear
employee_id0 = fields.Many2many('hr.employee', string='Employee', index=True)
department_id = fields.Many2many('hr.department', string="Department", store=True, required=True)
<field name="department_id" attrs="{'readonly':[('affec_type','=','category')],'invisible':[('affec_type','=','category')]}" widget="many2many_checkboxes"/>
<field name="employee_id0" attrs="{'invisible':[('affec_type','=','category')]}" widget="many2many_checkboxes" domain="[('department_id', 'in',department_id)]"/>