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

Hello 

I want to get the current user using the Odoo studio. Is there a way I can do it please?

Thank you in advance!

아바타
취소
베스트 답변

Hi,
First you have to create a many2one field with related model as Users(res.users).
After creating the field a compute function can given to the field in order to compute the current user. For that you can click on the ‘More’ button at the left bottom corner and will be redirected to the field properties. There under the ‘Advanced Properties’ section we can give the required dependencies and the compute function in python code as:

for record in self:
record ['x_studio_many2one_field'] = record.env.user

Now the field will compute the current user as its value.

Hope it helps

아바타
취소

What are the required Dependencies?

관련 게시물 답글 화면 활동
1
7월 25
1290
2
3월 25
1558
0
2월 25
1199
0
2월 25
1415
0
2월 25
1338