Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2832 มุมมอง

Using a scheduled task, I need to send an email which will inform on the status of open tasks. After getting the recordset correponding to my search, I found how to load the template and send the email:

mail_template = self.env.ref('test_email.email_template')
mail_template.send_mail(self.id)

But I only got access to the current record in $object. I would like to be able to pass the recordset to the template and loop over it. 

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Easy way is to pass the recordset using context. Go thanks and upvote CZoellner

https://stackoverflow.com/questions/71559930/


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Email Template subject parameters แก้ไขแล้ว
1
ก.พ. 24
2497
1
ก.ค. 23
3399
How to round sum of if code แก้ไขแล้ว
1
พ.ค. 22
4435
3
ธ.ค. 23
19126
Failed to render template แก้ไขแล้ว
1
ก.พ. 22
6145