Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

openerp schedule server action

Tags:

python

openerp

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" ?

like image 342
3a2roub Avatar asked Jan 18 '23 04:01

3a2roub


1 Answers

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.

like image 65
Nilesh Avatar answered Jan 22 '23 22:01

Nilesh