콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
24451 화면

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

아바타
취소
작성자 베스트 답변

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

아바타
취소
베스트 답변

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

아바타
취소
관련 게시물 답글 화면 활동
3
5월 25
2727
0
12월 23
2419
1
7월 23
2477
0
7월 22
1939
3
9월 21
21979