Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
24592 Visualizações

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

Avatar
Cancelar
Autor Melhor resposta

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
Cancelar
Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
3
mai. 25
2874
0
dez. 23
2553
1
jul. 23
2598
0
jul. 22
2031
3
set. 21
22401