This question has been flagged
5 Replies
6751 Views

I have a question regarding odoo/openerp mail handling for typical situation. Here is the scenario:- I am using some odoo and performed any transaction that would trigger an email to my client, now for consideration I didn't have internet connected at that moment will odoo handle that on later stage like if the system will look for emails that got failed due to any reason and retry the same.

I tried to make a deeper drive for the same in Automation Panel I was able to see scheduled action I was able to see Email Queue Manager I did all the settings it had. Now the issue is I wanna know what odoo is using in back-end like Crontab or any other kind of scheduler that will let you me know if the schedules have been qued and wait for the same to hit the script and process the Que.

Any one who know odoo will be able to answer the question. If you are not getting my question and are aware of odoo. Please let me know. I will do my best to explain the situation.

Thanks and Regards

Chand Prakash

Avatar
Discard
Best Answer

Odoo have it's own cron solution for triggering the tasks saved in the ir.cron model. Every cron definition define a call to a target model function that implements the needed behavior of the task. The target model function, in this case function for Email Queue Manager is the responsible for clean up the failed or delayed email messages. The cron of Odoo consist of independents Threads/Workers that scan and execute the cron task definitions 

The process_email_queue function used by the referenced cron look for mail.mail objects with state = outgoing. Those emails that are not delivered get an state = exception. For those you could put back to the outgoing state by the Retry button or you could define the context in the args for that cron task with a filter key-value containing a domain to match the exception state like:

<field eval="'(None,{\'filters\': [\'|\'(\'state\', \'=\', \'exception\')]})'" name="args"/>

or directly in the ir.cron form in the field args

"(None,{'filters': ['|'('state', '=', 'exception')]})"


Avatar
Discard

So the other part of this question was "does OpenERP retry sending emails that failed, for instance if your SMTP server is down at the moment you sent them?" Im running 8.0 and sent invoices via email while SMTP was down and I am wondering if they should be automatically sent. Its been a few hours and I have not seen them so I am wondering if this means my scheduler is broken.

Check the answer for a way to process emails with exception state

Best Answer

Module mail_tracking shows email notification tracking status for any messages in mail thread (chatter). Each notified partner will have an intuitive icon just right to his name.


When user sends a message in mail_thread (chatter), for instance in partner form, then an email tracking is created for each email notification. Then a status icon will appear just right to name of notified partner

Avatar
Discard