简体   繁体   中英

openerp schedule server action

In OpenERP 6.0.1, I've created a server action to send a confirmation email after an invoice is confirmed, and linked it to appropriately to the invoice workflow. now normally when an invoice is confirmed, an email is automatically sent.
is there a way to set a date for when the email should be sent instead of being sent immediately? like "send email after one week of confirmation" ?

There is a one object ir.cron which will run on specific time period. There you can specify the time when you want to sent the mail.

This object will call the function which you given in Method attribute. In this function you have to search for those invoices which are in created state. Then check the date when it created and if its >=7 days then send mail.

Or

You can create ir.cron on specific workflow action of the invoice which will have Next Execution Date as after the 7 or 8 days.

我不知道,但我认为你也可以使用管理中的行为 - > shedular-> sheduled actions,否则ir.cron是安排外发电子邮件的最佳选择

With OpenERO 6.1 New Email Engine has Email Queue so what you just need to do it queue your Email on that email queue and we already have one Scheduled Action which processes this email queue at defined interval, so what you can do it you can change the trigger time of the same action. and you can see the email Engine api for how to queue your emails in email queue.

Regards

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM