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

I have created a website from Odoo's website builder. Each time a user submit a form, the user should receive an email, but the email is being sent to the Admin email used, instead of the current logged in user.

I have created a Server Action whereby i'm using:

To(Emails) : ${(user.email and '%s <%s>' % (user.name, user.email) or '')|safe}

This: ${(user.email and '%s <%s>' % (user.name, user.email) or '')|safe} is supposed to get me the current logged in user email, but the email is not being sent to the current user's email, but rather to the Admin email. In other words, the above expression is getting the Administrator email, but not the current user's email, perhaps getting the Admin as the current user even though another user is logged in.

I need to send this automatic email on each form submission to the specific logged in user.

아바타
취소
베스트 답변

Is there a call to sudo() somewhere?

could you try self.env.user.name instead of user.name?    


아바타
취소