跳至内容
菜单
此问题已终结
2 回复
24530 查看

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

形象
丢弃
相关帖文 回复 查看 活动
3
5月 25
2809
0
12月 23
2473
1
7月 23
2562
0
7月 22
1980
3
9月 21
22162