Skip to Content
Menu
This question has been flagged
2 Replies
24351 Rodiniai

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

Portretas
Atmesti
Autorius 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

Portretas
Atmesti
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

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
3
geg. 25
2453
0
gruod. 23
2306
1
liep. 23
2270
0
liep. 22
1859
3
rugs. 21
21724