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

Im trying to open up the email composer with my custom template to be able to send the open event.booth as an email.
However the composer that opens up is somehow empty (meaning there is no email text in it and the subject is default and the recipient is empty)
This is what it looks like (image)

Now, the template on the bottom right is correct. But the text is missing.
When I respect the template at the bottom right, it looks like this:

This is what I want it to look like. As you can see here the template including subject and recipient is correct. It should open up like that!


This is the code how I open the composer

    def action_send_booth_confirmation_mail(self):
confirmation_template = self\.env\.ref\('rectanglemaps\.event_booth_confirmation_mail_template'\)
\ \ \ \ \ \ \ \ for\ rec\ in\ self:
\ \ \ \ \ \ \ \ \ \ \ \ composer\ =\ self\.env\['mail\.compose\.message'\]\.with_context\(\{
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 'default_template_id':\ confirmation_template\.id,
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 'default_composition_mode':\ 'comment',
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 'default_res_id':\ rec\.id,
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 'default_model':\ 'event\.booth',
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 'default_use_template':\ True,
\ \ \ \ \ \ \ \ \ \ \ \ \}\)\.create\(\{\}\)
\ \ \ \ \ \ \ \ \ \ \ \ return\ \{
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 'name':\ 'Send\ Email',
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 'type':\ 'ir\.actions\.act_window',
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 'view_mode':\ 'form',
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 'res_model':\ 'mail\.compose\.message',
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 'view_id':\ self\.env\.ref\('mail\.email_compose_message_wizard_form'\)\.id,
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 'target':\ 'new',
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 'res_id':\ composer\.id,
\ \ \ \ \ \ \ \ \ \ \ \ \}

https://pastebin\.com/JtKA0sGS

And\ this\ is\ the\ template\ \(but\ it\ works\ fine\ if\ I\ preview\ in\ Technical\ >\ Mail\ Templates\ and\ on\ the\ second\ try\ so\ I\ dont\ think\ the\ problem\ is\ here\?\)
https://pastebin.com/M7bMdsmm


I added pastebin to both because odoo code inline is not working properly

아바타
취소
관련 게시물 답글 화면 활동
0
12월 22
777
0
4월 23
3049
1
8월 22
2691
1
6월 25
1602
3
7월 25
3250