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

CRM module is untouched, means not any customization made yet.

please help in writing domain filter for Record Rule to get all user's data whose Manager is currently logged-in user including his/her data in CRM leads. what i have tried yet, mentioned below with errors it is showing.

['|', ('user_id.employee_id.manager_id', '=', user_id), ('user_id', '=', user_id)]

ValueError: : "name 'user_id' is not defined" while evaluating
"['|', ('user_id', '=', user_id), ('user_id.employee_id.manager_id', '=', user_id)]"

['|', ('user_id', '=', user\\.id\\),\\('hr_employee\\.parent_id\\.user_id',\\ '='\\ ,\\ user.id)]

raise ValueError("Invalid field %s.%s in leaf %s" % (model._name, path[0], str(leaf)))
ValueError: Invalid field crm.lead.hr_employee in leaf ('hr_employee.parent_id.user_id', '=', 2)


regards


الصورة الرمزية
إهمال
أفضل إجابة

Hi,

Can you please try this way,

['|', ('user_id', '=', user.id), ('user_id.employee_ids.parent_id.user_id', '=', user.id)]

Thanks

الصورة الرمزية
إهمال
الكاتب

@Savya Sachin thank you for your interest to help. i applied it and run CRM, it showed me the default Pipeline in kanban view, i removed default filter My Profiles but still it is showing only the data related with logged-in user Mitchell Admin and NOT his sub-ordinate Marc Demo's data which should appear. please guide me. i have its default filter with your given filter.
please, also help to post here in this forum because my post contains back slashes in 2nd example and your's has no back slash to disturb the code.

الكاتب

it works now, there was some unknown problem, i deleted record rule and copy the code again from your post and it worked fine now. thanks very much for your help.

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مارس 24
1279
0
أغسطس 22
722
0
مارس 15
4585
1
يناير 24
2010
1
نوفمبر 23
2087