跳至內容
選單
此問題已被標幟
2 回覆
24404 瀏覽次數

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
2675
0
12月 23
2388
1
7月 23
2430
0
7月 22
1897
3
9月 21
21891