I need Many2one field only show names that are in a specific group. For example: show all members from group purchase_managers in drop down. Please help me =)
I have .py
assigned_to = fields.Many2one('res.users', 'Approver',
track_visibility='onchange')
view
<field name="assigned_to"
attrs="{'readonly': [('is_editable','=', False)]}"/>
We can handle it in .py file with domain attribute.
domain=[('field_name', 'operator', value)])
Try with following code:
assigned_to = fields.Many2one('res.users', 'Approver',
track_visibility='onchange', domain=[('is_editable', '=', True)])
Result:
It will load data which User has is_editable checked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With