Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
24593 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
2874
0
dic 23
2553
1
lug 23
2598
0
lug 22
2031
3
set 21
22401