Hello guys,
Our goal is to send a email to administrator instead of creating a lead via the website_crm form.
But I'm not able to override correctly the contactus class and his create_lead method to correctly send an email instead of creating a lead.
Here is my last try. It doesn't work. (error is : Model contactus_pt is declared but cannot be loaded!)
from openerp.addons.website_crm.controllers.main import contactus
class contactus_pt(osv.AbstractModel):
_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=_("pasdfas"), context=ctx)
return request.registry['crm.lead'].create(cr, SUPERUSER_ID, values, context=dict(context, mail_create_nosubscribe=True))
The message_post method has to work! I need it there. I will adjust all the parameters. But now, the class is not even loaded.
Please help. I'm tired of this problem!