Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
7388 Weergaven

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?

Avatar
Annuleer

Hello Kahina, did you find a solution?

hello, Did you find the solution?

Beste antwoord

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


Avatar
Annuleer
Beste antwoord

Hi,

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





Avatar
Annuleer

Hi,

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

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

Auteur

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)

Beste antwoord

Hello, yes you can use it by using uid 

Example

('user_id','=',uid)


Avatar
Annuleer
Auteur

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)

Gerelateerde posts Antwoorden Weergaven Activiteit
1
mei 25
3045
1
mei 24
2562
1
apr. 24
2204
2
feb. 24
3851
3
mei 22
2293