Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
24468 Widoki

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

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
maj 25
2749
0
gru 23
2431
1
lip 23
2486
0
lip 22
1944
3
wrz 21
21998