How to get the current user id in an Odoo Web Controller ?
此问题已终结
2
回复
26347
查看
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
| 相关帖文 | 回复 | 查看 | 活动 | |
|---|---|---|---|---|
|
|
1
11月 25
|
4936 | ||
|
|
4
11月 25
|
5131 | ||
|
|
1
6月 23
|
4487 | ||
|
|
0
7月 22
|
3749 | ||
|
|
3
9月 21
|
28082 |
Refer this: http://bit.ly/get-current-logged-in-user-id-in-odoo