Odoo Help


How to receive messages from this form (website_crm)?

Pascal Tremblay
on 10/25/15, 1:36 PM 1,101 views

Hello all,

I have installed the module website_crm.

I have put this new form on my website.contactus page.

Now, none message is received. How to receive message sent by public users on the site???

Thanks for your tip 

the outgoing mail server is configured.


I have this code :

from openerp.addons.website_crm.controllers.main import contactus
class contactus_pt(contactus):
    _inherit = ['mail.thread']

    def create_lead(self, request, values, kwargs):
       """ Allow to be overrided """
       cr, context = request.cr, request.context
        self.message_post(cr, uid, [new_id], body=_("prout prout"), context=ctx)           return request.registry['crm.lead'].create(cr, SUPERUSER_ID, values, context=dict(context, mail_create_nosubscribe=True))

I get this error :

    AttributeError: 'contactus (extended by contactus_pt)' object has no attribute 'message_post'

I can understand that my code is not still right, but why do I get this error? I have well inherited the mail.thread class no? So I could use message_post? No?


Emipro Technologies Pvt. Ltd.

--Emipro Technologies Pvt. Ltd.--
| 6 7 8
Rajkot, India
--Emipro Technologies Pvt. Ltd.--

Being an emerging leader in IT market since 2011, Emipro Technologies Pvt. Ltd. has been providing a wide range of business solutions in Odoo & Magento. We are pleased to have a large pool of contented customers with our meticulous work in the domain of ERP & e-Commerce. A ray of relief & satisfaction to  our customers heart by our successful deployment in their organization, purely represents our success in Odoo platform. Hence, we take pride for being an Odoo partner with a vision of expanding our strategic alliances with our customers to offer them high value-added, trustworthy & cost effective solutions.


Since establishment, our business has span across 11 countries of the world. Our customers are companies of all sizes ranging from start-ups to large enterprises, who realize that they need a professional business solutions to generate revenue streams, establish proper communication channels or streamline business operations. Standing with strong determination of customer satisfaction, observing each minute detail of their business processes, providing proper guidance and moving forth to develop product accordingly adds our value and reliability among our customers. 


We are blessed with efficient, passionate & eclectic young developers who have come across almost all kinds of business profiles, working with full dedication, applying creativity & new features in existing modules and completing customer's projects successfully on predefined target. Our in-depth knowledge while giving business solutions in Odoo allows us to offer following services to our customers :


  • Consulting
  • Installation, Configuration & Customization
  • Training & Support
  • Maintenance
  • Upgradation
  • Documentation
  • Crafting community modules
  • Drafting videos on demand
  • Smart Apps development

We will be :) to welcome you @ www.emiprotechnologies.com to solve any kind of your business needs around Odoo. However we are just an inch away from you by email info@emiprotechnologies.com or a tweet to @EmiproTech

Emipro Technologies Pvt. Ltd.
On 10/26/15, 12:33 AM

This website form will create a Lead in back end side. If lead is not able to create at back side then there must be command line error. You need to paste it over here so I can suggest something.

If you want to get email then you have 2 options.

1. Create Lead & Get email :

In this option, let lead creation process as it is and you use server action. Please define a server action like when new lead created, your user assign as a responsible user of that lead. So when any user being a responsible, they automatically added as follower of that lead. And when you be follower of any lead, you will automatically get an email. 

2. Don't create lead and get only email :

In this option, go to website_crm >> controllers >> main.py file and override the following method,

 def create_lead(self, request, values, kwargs):
""" Allow to be overrided """
    cr, context = request.cr, request.context
    return request.registry['crm.lead'].create(cr, SUPERUSER_ID, values, context=dict(context, mail_create_nosubscribe=True))
In this method, override the create method and use message_post method to send email to particular partner.

Here I have just given the way / logic not the exact code. From your "broad" experience from Odoo forum so far, I think you are capable enough to code yourself.

All the best !


Thanks. Do you think we could receive a email instead of creating a lead?

Pascal Tremblay
on 10/26/15, 9:32 AM

@pascal, I have updated my answer.

Emipro Technologies Pvt. Ltd.
on 10/26/15, 10:36 AM

You are really nice. Be sure I will try it very soon. thanks 10 times.

Pascal Tremblay
on 10/26/15, 7:46 PM

The message_post method doesn't seem to send an email. This method rather write a message in the bottom social section when we edit a lead.

Pascal Tremblay
on 11/7/15, 7:45 PM

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

1 follower(s)


Asked: 10/25/15, 1:36 PM
Seen: 1101 times
Last updated: 11/2/15, 11:01 PM