콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
1910 화면

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
2148
0
5월 21
1986
1
3월 24
3458
0
8월 24
1542
3
6월 25
2627