Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
24477 Переглядів

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

Аватар
Відмінити
Автор Найкраща відповідь

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

Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
3
трав. 25
2759
0
груд. 23
2436
1
лип. 23
2494
0
лип. 22
1949
3
вер. 21
22009