上传的图像用于项目: 'CST技术支持'
  1. CST技术支持
  2. SLAL2-1535

LVMH 微信以及邮件提醒模板增加英文模板

XMLWord打印

    • Icon: Change Change
    • 解决结果: 完成
    • Icon: Medium Medium
    • 202012
    • Y-易路产品-
    • 客户:LVMH 编码:qianbaouat
    • 基础通用功能
    • 隐藏

      再配置一个英文模版,并修改定时任务代码如下:
      employees = env['hr.employee'].search(cr, 1, [('active', '=', True),('work_activity','=','in_service'),('state','in',['done','waiting','waiting_sign','archived'])])
      today = datetime.today()
      year_begin = today.replace(day=1,month=1).strftime('%Y-%m-%d')
      year_end = today.replace(day=31,month=12).strftime('%Y-%m-%d')
      email_template_id = env['mail.template'].search(cr,1,[('active','=',True),('name', '=', '披露声明通知')])
      we_chat_template = env['wechat.message.template'].search(cr,1,[('active','=',True),('code', '=', 'WT030')])
      we_chat_template_en = env['wechat.message.template'].search(cr,1,[('active','=',True),('code', '=', 'WT032')])

      user_id_list = []
      for employee in employees:
      declear = env['x_af_2020_0005'].search(cr,1,[('employee_id','=',employee),('submit_date','>=',year_begin),('submit_date','<=',year_end)])
      if not declear:
      employee_instance=env['hr.employee'].browse(cr,1,employee)
      user_id_list.append(employee_instance.user_id.id)
      env['mail.template'].browse(cr,1,email_template_id).with_context(lang=employee_instance.user_id.lang).send_mail(employee, force_send=False, raise_exception=True)
      wechat_message = env['wechat.message'].create(cr,1,

      { 'model': employee_instance._model, 'res_id': employee_instance.id, 'template': we_chat_template[0] if employee_instance.user_id.lang=='zh_CN' else we_chat_template_en[0], 'receivers': [(6, 0, [employee_instance.user_id.id])], 'sender': uid, 'content': env['wechat.message.template'].browse(cr,1,we_chat_template[0]).content if employee_instance.user_id.lang=='zh_CN' else env['wechat.message.template'].browse(cr,1,we_chat_template_en[0]).content, 'wechat_application': 2 }

      )
      wechat_message_instance = env['wechat.message'].browse(cr,1,wechat_message)
      wechat_message_instance.send()

      显示
      再配置一个英文模版,并修改定时任务代码如下: employees = env ['hr.employee'] .search(cr, 1, [('active', '=', True),('work_activity','=','in_service'),('state','in', ['done','waiting','waiting_sign','archived'] )]) today = datetime.today() year_begin = today.replace(day=1,month=1).strftime('%Y-%m-%d') year_end = today.replace(day=31,month=12).strftime('%Y-%m-%d') email_template_id = env ['mail.template'] .search(cr,1, [('active','=',True),('name', '=', '披露声明通知')] ) we_chat_template = env ['wechat.message.template'] .search(cr,1, [('active','=',True),('code', '=', 'WT030')] ) we_chat_template_en = env ['wechat.message.template'] .search(cr,1, [('active','=',True),('code', '=', 'WT032')] ) user_id_list = [] for employee in employees: declear = env ['x_af_2020_0005'] .search(cr,1, [('employee_id','=',employee),('submit_date','>=',year_begin),('submit_date','<=',year_end)] ) if not declear: employee_instance=env ['hr.employee'] .browse(cr,1,employee) user_id_list.append(employee_instance.user_id.id) env ['mail.template'] .browse(cr,1,email_template_id).with_context(lang=employee_instance.user_id.lang).send_mail(employee, force_send=False, raise_exception=True) wechat_message = env ['wechat.message'] .create(cr,1, { 'model': employee_instance._model, 'res_id': employee_instance.id, 'template': we_chat_template[0] if employee_instance.user_id.lang=='zh_CN' else we_chat_template_en[0], 'receivers': [(6, 0, [employee_instance.user_id.id])], 'sender': uid, 'content': env['wechat.message.template'].browse(cr,1,we_chat_template[0]).content if employee_instance.user_id.lang=='zh_CN' else env['wechat.message.template'].browse(cr,1,we_chat_template_en[0]).content, 'wechat_application': 2 } ) wechat_message_instance = env ['wechat.message'] .browse(cr,1,wechat_message) wechat_message_instance.send()

      LVMH 微信以及邮件模板【披露申明通知】增加英文模板。

      Dear XXX,

      根据公司政策,您需要在2021年2月28日前,完成“披露申明书 – 利益冲突”的更新,请点击本消息完成更新。

      Dear XXX,

      Upon company policy, Please kindly renew your “DISCLOSURE FORM ON CONFLICTS OF INTEREST” by clicking this message before 28 Feb, 2021.

            grant.yang 杨光磊
            claire.li 李忻吟
            表决:
            0 为这个问题表决

              创建日期:
              已更新:
              已解决: