Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
24469 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
2749
0
dez. 23
2431
1
jul. 23
2486
0
jul. 22
1944
3
set. 21
21998