Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
9230 Näkymät

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
Hylkää
Paras vastaus

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
Hylkää
Paras vastaus

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

Avatar
Hylkää
Tekijä

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

Error: NameError: name 'user' is not defined

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
huhtik. 24
4270
6
elok. 20
9241
0
huhtik. 15
8046
3
heinäk. 25
4509
0
toukok. 25
965