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
ตอบกลับ
24403
มุมมอง
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 |
Refer this: http://bit.ly/get-current-logged-in-user-id-in-odoo