Skip to Content
Menu
This question has been flagged
1 Reply
2576 Views

Hello everybody,

I want to show in the field user_id from the hr_employee form only users who are not related to an employee.

How can I do it?

Best regards

Avatar
Discard
Best Answer

Try changing the field definition in XML from

<field name="user_id" string="Related User"/>

to 

<field name="user_id" string="Related User" domain="[('employee_ids', '=', False)]"/>

This will add a filter to the field restricting the selectable users to those that are not yet linked to an employee.

Avatar
Discard