Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2852 Lượt xem

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. 

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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

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


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 24
2517
1
thg 7 23
3423
1
thg 5 22
4460
3
thg 12 23
19137
1
thg 2 22
6168