Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
7386 Widoki

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?

Awatar
Odrzuć

Hello Kahina, did you find a solution?

hello, Did you find the solution?

Najlepsza odpowiedź

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


Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

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





Awatar
Odrzuć

Hi,

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

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

Autor

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)

Najlepsza odpowiedź

Hello, yes you can use it by using uid 

Example

('user_id','=',uid)


Awatar
Odrzuć
Autor

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)

Powiązane posty Odpowiedzi Widoki Czynność
1
maj 25
3042
1
maj 24
2561
1
kwi 24
2202
2
lut 24
3848
3
maj 22
2291