تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
3138 أدوات العرض

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
سبتمبر 20
71899
2
سبتمبر 23
9602
1
أبريل 22
2523
Many2One Domain تم الحل
1
يوليو 20
5690
0
مارس 15
4797