Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
24441 Zobrazení

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

Avatar
Zrušit
Autor Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
kvě 25
2715
0
pro 23
2410
1
čvc 23
2465
0
čvc 22
1936
3
zář 21
21955