Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3216 Widoki

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?

Awatar
Odrzuć

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

Najlepsza odpowiedź

Hi Muhammad: Try the following domain on the field

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
wrz 20
71942
2
wrz 23
9667
1
kwi 22
2603
Many2One Domain Rozwiązane
1
lip 20
5735
0
mar 15
4808