How to get the current user id in an Odoo Web Controller ?
คำถามนี้ถูกตั้งค่าสถานะ
2
ตอบกลับ
26358
มุมมอง
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 | ตอบกลับ | มุมมอง | กิจกรรม | |
|---|---|---|---|---|
|
|
1
พ.ย. 25
|
4955 | ||
|
|
4
พ.ย. 25
|
5147 | ||
|
|
1
มิ.ย. 23
|
4502 | ||
|
|
0
ก.ค. 22
|
3754 | ||
|
Odoo? Why this new name?
แก้ไขแล้ว
|
|
3
ก.ย. 21
|
28100 |
Refer this: http://bit.ly/get-current-logged-in-user-id-in-odoo