コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
24495 ビュー

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
2772
0
12月 23
2453
1
7月 23
2511
0
7月 22
1959
3
9月 21
22062