Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
24470 Visualizzazioni

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

Avatar
Abbandona
Autore Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
3
mag 25
2749
0
dic 23
2431
1
lug 23
2486
0
lug 22
1944
3
set 21
21998