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

I'm trying to send an email to multiple people and I need to fill in recipients of an email template. Thier ids are stored in a many2many field (email template is attached to a Maintenance Request model): 
object.maintenance_team_id.member_ids

I want to extract email from that field so I can use it as the mail recipients in the template - where I need comma-separated list of all emails.

I went to jinja2 site and found syntax for the for loop so I typed something like this to test it:

${{% for member_id in object.maintenance_team_id.member_ids %}    {{member_id.email}},{% endfor %}}
But this does not work - breaks whole email.

I have found this thread:
https://www.odoo.com/es_ES/forum/ayuda-1/question/how-set-to-field-of-email-template-with-a-many2many-field-83510
but they solved this by modyfining python code and I don't really get the explanation there. So I would like to solve this with jinja2.

아바타
취소
관련 게시물 답글 화면 활동
2
2월 25
1523
2
1월 24
1736
2
12월 23
1704
1
12월 23
1567
1
6월 23
1996