Skip to Content
Menu
This question has been flagged
1 Atsakyti
3229 Rodiniai

Hii,

I have a Many2one custom field on hr.leave model. 

substitute_employee_id = fields.Many2one('hr.employee', string='Substitute Employee')
<field name="substitute_employee_id"/>

Currently substitute_employee_id shows all employees from hr.employee model on the view.

1. I want to show all employees instead of currently logged in employee in substitute_employee_id field? 

2. How to show logged in user department employees only and not currently logged in employee? 

How to apply a filter or domain on python or xml?

Portretas
Atmesti

In future this will helps: https://goo.gl/8HgnCF

Best Answer

Hi Muhammad: Try the following domain on the field

<field name="substitute_employee_id" domain="[('user_id', '!=', uid)]"/>

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
3
rugs. 20
71958
2
rugs. 23
9676
1
bal. 22
2624
1
liep. 20
5746
0
kov. 15
4814