콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다


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"/>
아바타
취소
관련 게시물 답글 화면 활동
1
6월 18
6054
0
4월 18
3527
1
3월 25
1072
1
5월 23
10165
1
2월 24
13190