コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
7349 ビュー

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
2998
1
5月 24
2535
1
4月 24
2149
2
2月 24
3821
3
5月 22
2270