Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3 Відповіді
9342 Переглядів


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> 


Аватар
Відмінити
Автор Найкраща відповідь

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. 

Аватар
Відмінити
Найкраща відповідь

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.

Аватар
Відмінити
Найкраща відповідь

To get logged in user id  try this 

<p t-field="o.env.user.id"/>
Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
черв. 18
5967
0
квіт. 18
3479
1
бер. 25
960
1
трав. 23
10037
1
лют. 24
13064