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


Hi all, how can we get the logined user id in qweb template , it is not a report template.

It's the mail.activity_items template. i need to put a condition on 'o_thread_message_tools' based on the logined user id. 

My intention is to get the logined user id in qweb template.

Sample code i tried is,    

<t t-if="activity.create_uid[0] == user.id">

#code

</t> 


Avatar
Annuleer
Auteur Beste antwoord

These are not working in mail.activity_items template, so i'm trying to pass 'uid' value in mail_activity.js file in this template rendering code. I dont have much points to comment on the answers @Rakesh Vadeghar and @Mitul Shingala. 

Thank you very much  for the support. 

Avatar
Annuleer
Beste antwoord

Hello

try with below line

<span t-esc="activity.env.user.id"/>

so your condition is like

<t t-if="activity.create_uid.id == activity.env.user.id">

i hope this will helps you.

Avatar
Annuleer
Beste antwoord

To get logged in user id  try this 

<p t-field="o.env.user.id"/>
Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
jun. 18
5963
0
apr. 18
3477
1
mrt. 25
958
1
mei 23
10033
1
feb. 24
13060