Odoo Help


How can we process incoming emails

Kurt Haselwimmer
on 8/24/14, 2:23 AM 5,928 views

I wish to send emails to odoo to change data in specified records of an existing model in the system. Is there any documentation on this subject or a clear example that shows how to process a general purpose emal? As I wish to run on odoo-on-saas I cannot write a custom module but would be obliged to process the incoming email and update my data purely via server actions.

There are one or two posts on this system but these are out of date (the crm.lead description field is no longer written by the incoming email for example). Also there is no clear indication of whether a new record MUST be created - I have tried leaving this field blank and setting it to create a record of type message and neither seems to work.

Hans Martens
On 7/6/17, 3:13 PM

Hi Kurt,

Did you ever find a working example on how to propagate fields in the body of an incoming emal to certain records of an Odoo model? Even two years later I can only find the examples you allready mentioned, which are no longer relevant for current versions of Odoo. 

Thanks in advance!

Anders Wallenquist
On 8/24/14, 5:29 AM

Create an imap catchall-account for your domain and configure incomming mail for this account (settings -> General Settings). Odoo will create mail-aliases for most of you objects (settings -> Email -> Alias), you can also add you own aliases.

You can also add more incomming mail accounts and administer "Actions to Perform on Incoming Mails".



Anders thanks for the comment but this does not explain how to extract and act upon data extracted from the body of the email. This requires a server action - the previous posts that touch on this subject are clearly out of date now.

Hertford Developments Limited, Kurt Haselwimmer
on 8/24/14, 5:45 AM

You can add server actions in python-code for example: if context.get('active_model') == 'crm.lead' and context.get('active_ids'): self.case_mark_lost(cr, uid, context['active_ids'], context=context)

Anders Wallenquist
on 8/24/14, 5:50 AM

A worked example would help me and many other people I think. The existing semi-examples posted on odoo help have typos and also no longer work. 1 Its not clear whether a database record always needs to be created - eg if we just want to update, say a status field in a delivery order we don't need a new lead or delivery order to be created. 2 If we are not creating a record in one of the models how do we access the fields (subject, body etc) from the incoming email message. I tried creating message records but this does not seem to work (on saas5). If this can be demonstrated then it provides a useful mechanism for synchronisation with other online systems.

Hertford Developments Limited, Kurt Haselwimmer
on 8/24/14, 5:56 AM

Med Said BARA

--Med Said BARA--

| 5 5 7
--Med Said BARA--
Med Said BARA
On 8/24/14, 8:42 AM

Very interesting question.

But, how to parse the email content ?

Related question: https://www.odoo.com/forum/help-1/question/customize-the-auto-lead-creation-through-incoming-emails-272


Some links:



Can you tell me what you think about : https://github.com/Smile-SA/odoo_addons/tree/7.0/smile_action_trigger


The first ref 1) is the classic one on this forum - this didn't work because of the typos shown in 2. 2) no longer works because the email body is no longer put into the crm.lead description field when the email is received (this change was uploaded to github around feb 2013) 3) is a zapier reference. I assume that this requires a custom module in odoo and so is therefore incompatible with odoo-on-saas I have not come across 5) before - but it too looks like it would require a custom module to be installed in odoo - again making it incompatible with odoo-on-saas. I am sure that this must be possible with odoo server actions - it is just knowing how to get access to the email body content. After that we can parse that content and do pretty much whatever we would like with server actions.

Hertford Developments Limited, Kurt Haselwimmer
on 8/24/14, 10:23 AM

I think the email can be accessed via mail.mesagge model. The problem is how to trigger the server actions object?

Ben Bernard
on 8/25/14, 2:55 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 8/24/14, 2:23 AM
Seen: 5928 times
Last updated: 7/6/17, 3:13 PM