Odoo 12 Mail notification

十年热恋 提交于 2020-06-29 04:09:25

问题


In Odoo 12 I am trying to get a mail 90 days prior (before) to expiry of subscription and automatically I have created a email template and function for this but iam not receiving any mails

In py file: license_renewal_date = fields.Date("Renewal Date",track_visibility='onchange')

    def exp_date1(self):
    before_90_days = datetime.datetime.now().date()- datetime.timedelta(days = 90)
    exp_90days = self.env['(crm.lead.extended)'].search([('(license_renewal_date)','=',before_90_days)])
    template = self.env.ref('crm_extended.create_crm_lead_mail_template')
    template.send_mail(self.id, force_send=True)   

来源:https://stackoverflow.com/questions/62282254/odoo-12-mail-notification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!