3
我需要从Python代码通过objects
到email_template
:将数据传递给电子邮件模板10
*的.py
def _alert_product_expiry(self):
alert_data = self.search([('alert_date','=',fields.Date.today())])
if alert_data:
template_id = self.env.ref('alert_email_template')// Need to pass `alert_data` to template
send = template_id.send_mail(self.id, force_send=True)
template_body
<field name="body_html">
<![CDATA[
//Retrieve that object here and perform for loop. I don't know how retrieve it.
]]>
</field>
我该怎么办?