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
回覆
24404
瀏覽次數
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
|
2675 | ||
|
0
12月 23
|
2388 | ||
|
1
7月 23
|
2430 | ||
|
0
7月 22
|
1897 | ||
|
3
9月 21
|
21891 |
Refer this: http://bit.ly/get-current-logged-in-user-id-in-odoo