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
Această întrebare a fost marcată
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
Îți place discuția? Nu doar citi, alătură-te!
Creează-ți un cont astăzi pentru a beneficia de funcții exclusive și a interacționa cu minunata noastră comunitate!
Înscrie-te| Postări similare | Răspunsuri | Vizualizări | Activitate | |
|---|---|---|---|---|
|
|
2
ian. 24
|
4282 | ||
|
|
0
mai 21
|
3423 | ||
|
|
1
mar. 24
|
6426 | ||
|
|
0
aug. 24
|
3460 | ||
|
|
3
nov. 25
|
2380 |