Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
24411 Представления

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
2686
0
дек. 23
2392
1
июл. 23
2443
0
июл. 22
1904
3
сент. 21
21919