コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
1777 ビュー

I am trying to create an automated action, when I craete an activity I want to send an email a month before the deadline, now I am testing it and put 1 day only and it didn't work 



アバター
破棄
最善の回答

You would be better creating a Scheduled Action, but this will require some python knowledge. You run it every day at 1:00 am for example and it would look something like this:

acts = env['mail.activity'].search([()])

for a in acts:

    check_date = a.deadline_date - datetime.timedelta(months=1)

    if check_date == datetime.datetime.now().date():
          body = """text ""

​  vals = {

​    'subject' : '',

​    'email_from' : '',

​    'email_to' : '',

​    'body_html' : body

​  }

​  env['mail.mail'].sudo().create(vals)





アバター
破棄
著作者

I have standered Odoo I can't use code

関連投稿 返信 ビュー 活動
2
1月 24
1991
0
5月 21
1869
1
3月 24
3167
0
8月 24
1436
3
6月 25
2416