跳至內容
選單
此問題已被標幟
1 回覆
3144 瀏覽次數

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?

頭像
捨棄

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

最佳答案

Hi Muhammad: Try the following domain on the field

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
3
9月 20
71900
2
9月 23
9609
1
4月 22
2528
1
7月 20
5691
0
3月 15
4799