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
- โปรเจกต์
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
2
ตอบกลับ
25320
มุมมอง
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
|
3399 | ||
|
|
4
พ.ย. 25
|
3745 | ||
|
|
1
ก.ค. 23
|
3290 | ||
|
|
0
ก.ค. 22
|
2681 | ||
|
Odoo? Why this new name?
แก้ไขแล้ว
|
|
3
ก.ย. 21
|
25111 |
Refer this: http://bit.ly/get-current-logged-in-user-id-in-odoo