Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
24450 Prikazi

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

Avatar
Opusti
Avtor 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
Opusti
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
Opusti
Related Posts Odgovori Prikazi Aktivnost
3
maj 25
2727
0
dec. 23
2419
1
jul. 23
2477
0
jul. 22
1939
3
sep. 21
21979