Skip to Content
Menu
This question has been flagged

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


Avatar
Discard
Best Answer

Hi,

Can you please try this way,

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

Thanks

Avatar
Discard
Author

@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.

Author

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.

Related Posts Replies Views Activity
1
Mar 24
1284
0
Aug 22
722
0
Mar 15
4588
1
Jan 24
2014
1
Nov 23
2087