Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
2 Besvarelser
25019 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
3354
0
dec. 23
2987
1
jul. 23
3004
0
jul. 22
2376
3
sep. 21
23846