Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
8950 Vistas

i need to filter my view using domain the filter must use parameters for the connected user

my code : [('exercice_id','=', uid.exercice_id.id)]
on user class i have field named exercice_id

Avatar
Descartar
Mejor respuesta

For version 14, it is:

domain="[('user_id', '=', uid)]" 

You can search the View XML for your version, find the V14 XML definition of the CRM "My Leads" filter at https://github.com/odoo/odoo/blob/14.0/addons/crm/views/crm_lead_views.xml#L577

Avatar
Descartar
Mejor respuesta

You can get the current user in xml by using user.id so try to use user.exercice_id.id

Avatar
Descartar
Autor

Thanks CorText IT Solutuon for your response,
i got this error

Error: NameError: name 'user' is not defined

Publicaciones relacionadas Respuestas Vistas Actividad
2
abr 24
4007
6
ago 20
8955
0
abr 15
7775
3
jul 25
3813
0
may 25
708