How to get the current user id in an Odoo Web Controller ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- Project
- MRP
此问题已终结
2
回复
24442
查看
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
|
2715 | ||
|
0
12月 23
|
2410 | ||
|
1
7月 23
|
2465 | ||
|
0
7月 22
|
1936 | ||
|
3
9月 21
|
21955 |
Refer this: http://bit.ly/get-current-logged-in-user-id-in-odoo