How to check sent emails and messages in Odoo?

1 Answer
Best Answer

Preliminary set up
1) Activate the developer mode in order to be able to access the "Technical" menu in the settings. 

There is two places in Odoo where you can find information regarding the messages (emails, internal messages, invoices sent, quotations sent...) : Messages and Email. 

By default you will be able to see everything you need from Settings > Technical > Messages.
It is also possible to check the emails sent from Settings > Technical > Emails.

Issue? You can only see a few of these emails or maybe even none of them in Settings > Technical > Emails ! Why? 
Because there is an option in Odoo that deletes automatically these emails from this menu in order to save space which is really important for the efficiency of the database on the long term. Nevertheless, if you really need to see these information in Settings > Technical > Emails, then you need to change some set up on each email templates. 

In fact, there is the "auto delete" checkbox in the advanced settings of each template that you can decide to (un)tick in order to have the related emails saved or not in your Settings > Technical > Emails

1 Comment

And what could be the best option to display a status on account move model: sent, not sent, error (bounce, recipient) ?

In case where emails are set to be auto deleted.

The is a general is_move_sent on account.move model that I can select the ones sent, but then for the wrong recipient email address or bounce how can I filter them ?

There is also a message_has_error on the account.move but which appears to be false for a case where the email has not been sent (there's a red envelope on the chatter message) so it doesn't seem reliable

Taking a look on the query of message_has_error compute in mail.thread model, I see that's binding also on the author id to be the signed in user (which might be wrong from my POV because maybe I want that any user to see if an invoice has been successfully sent or not)

I still cannot use that manual query without the user check because that will only return the number of messages with errors without being sure they are actually emails containing invoice but more problematic would in case of a successful resend

If I am looking on the mail.message there is NO straight forward option to filter emails sent with the invoices to the customers from the other chatter messages

Some messages appear to be of type email and other comment

Some of them have and others not notified_partner_ids and thus with or without any notification status that we can look for an error notification

So what would be the best option ?