İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
24699 Görünümler

How to get the current user id in an Odoo Web Controller ?

Avatar
Vazgeç
Üretici En İyi Yanıt

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

Avatar
Vazgeç
En İyi Yanıt

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

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
3
May 25
3034
0
Ara 23
2659
1
Tem 23
2717
0
Tem 22
2120
3
Eyl 21
22775