Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
2820 Vistas

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
Descartar
Mejor respuesta

Hi,

Can you please try this way,

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

Thanks

Avatar
Descartar
Autor

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

Autor

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.

Publicaciones relacionadas Respuestas Vistas Actividad
1
mar 24
1279
0
ago 22
722
0
mar 15
4577
1
ene 24
2001
1
nov 23
2083