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

Hello,


I would like to know how to get current user (record in res.users) in XML view knowing that I would like to use it in a domain, let's say : ('field',  "=",  current_user.field.id) 

Is it possible to get cureent_user using "uid" or is there any other way to do it?

아바타
취소

Hello Kahina, did you find a solution?

hello, Did you find the solution?

베스트 답변

You can use [user.id]  or uid in your Xml.


아바타
취소
베스트 답변

Hi,

You can use UID to get the login user in XML ,





아바타
취소

Hi,

You can use UID to get the login user in XML ,

<field name="user_id" string="Related User" domain="[('id', '=', uid)]"/>

작성자

That does not work in a case where I would like to compare a field with the same field value of current user, something like this : ('field', "=", current_user.field.id)

베스트 답변

Hello, yes you can use it by using uid 

Example

('user_id','=',uid)


아바타
취소
작성자

I would like to compare not user_id field but another field of the current user with the same field in the current model, something like this : ('field', "=", current_user.field.id)

관련 게시물 답글 화면 활동
1
5월 25
3085
1
5월 24
2613
1
4월 24
2243
2
2월 24
3893
3
5월 22
2321