Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
2 Besvarelser
24473 Visninger

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

Avatar
Kassér
Forfatter Bedste svar

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
Kassér
Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
3
maj 25
2753
0
dec. 23
2432
1
jul. 23
2487
0
jul. 22
1944
3
sep. 21
22000