Skip to Content
Menu
This question has been flagged
2 Replies
24516 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
2779
0
dec 23
2462
1
júl 23
2528
0
júl 22
1965
3
sep 21
22099