Odoo Help

2 Answers

Ermin Trevisan

--Ermin Trevisan--
| 6 5 7
Walchwil, Switzerland
--Ermin Trevisan--

Ermin Trevisan
2/20/17, 6:13 PM

I've spent the hell a lot of time to find out a reasonable way....this is my suggestion:

1. Email Server Setup
Setup a standard incoming email server with a catchall account as described everywhere. Setup a standard SMTP server. It is not necessary to use stuff like SMTP per user or so.

2. User email address and user email alias
Setup a user email address for the default sales person on the same domain as the catchall domain, setup an email alias with a different name in order to avoid dead locks. Example:
- user email address: john.doe@example.com
- user email alias: john-doe@example.com, set the notification preference to "always receive notifications..."

3. Website Admin: Set the default salesperson and sales team. This is nice, but has unfortunately absolutely no effect. All website contacts are nevertheless only assigned to the admin user. So we have to setup an automated action to correct this faulty behaviour which Odoo is not willing to change (see https://www.odoo.com/forum/help-1/question/how-to-set-the-default-sales-person-for-e-commerce-orders-instead-of-administrator-87414 and https://github.com/odoo/odoo/issues/4682)

4. Difference between message subtype "discussion" and message subtype "internal note"

When somebody sends an email message to a valid odoo alias (for example to sales@example.com), then this is a message of the subtype discussion. For such messages email notifications are sent to the followers according to the notification preference of the users. In this case we do not have a problem.
But messages from the creation of new lead through the website contact form are internal notes, and for internal notes there is no automatic email notification in standard Odoo. So we have to create our own automated action to do this.

This process has 3 steps, first we create an email template to define a proper message, secondly we create a server action which sends an email notification using our defined template and at last we define an automated action, which assigns the new lead created to the default sales person and sends an email notification.
Step 1:
Duplicate the email template "Reminder to User" and adapt it according your taste, rename it for example as "New Lead Notification"
Step 2:
Create a server action named "New Lead Notification", action to do: send email, base model "Lead/Opportunity", email template "New Lead Notification"
Step 3:
Create an automated action to assign the new lead to the default sales person and send an email notification to this sales person:
Create a new automated action, name it "Assign default sale person to lead", set "when to run" as "On creation", then on the Actions tab define the "Responsible" as your default sales person and add him and others as followers as you like. Under "Server actions to run" add our server action defined in Step 2.
Please make sure you have installed the module base_action_rule (Odoo <=10.0) or base_automation (Odoo 11.0).


Side note: If you are doing this, you have to use a SMTP/MTA service which allows to relay messages, because the sender is the original sender of the email or the contact request outside of Odoo and this message is forwarded by Odoo to the sales person also outside of Odoo, this is not always accepted (Amazon SES for example does not accept it).

Philippe Thuaud
2/23/17, 5:21 AM

Thanks @Ermin

It worked for me.

Ask a Question
Keep Informed
1 follower(s)
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