Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
24403 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
พ.ค. 25
2671
0
ธ.ค. 23
2386
1
ก.ค. 23
2428
0
ก.ค. 22
1896
Odoo? Why this new name? แก้ไขแล้ว
3
ก.ย. 21
21888