Skip to Content
Menu
This question has been flagged
2 Replies
24812 Zobrazenia

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

Avatar
Zrušiť
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
Zrušiť
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
Zrušiť
Related Posts Replies Zobrazenia Aktivita
3
máj 25
3163
0
dec 23
2748
1
júl 23
2838
0
júl 22
2211
3
sep 21
23131