Skip to Content
Menú
This question has been flagged
2 Respostes
24211 Vistes

How to get the current user id in an Odoo Web Controller ?

Avatar
Descartar
Autor Best Answer

Hi Yenthe,

In Odoo 8, inside a web controller it doesn't work for me and I'm using that codes instead :

request.uid

or

request.session.uid

Regards,
Slim

Avatar
Descartar
Best Answer

Hi Slim,

You can get the user his id out of the environment its context like this:

http.request.env.context.get('uid')

Regards,
Yenthe

Avatar
Descartar
Related Posts Respostes Vistes Activitat
3
de maig 25
2379
0
de des. 23
2240
1
de jul. 23
2215
0
de jul. 22
1808
3
de set. 21
21532