تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
1490 أدوات العرض

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
يناير 24
1596
0
مايو 21
1614
1
مارس 24
2692
0
أغسطس 24
1110
3
يونيو 25
1967