콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
5282 화면

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.



EDIT #1

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?


아바타
취소
베스트 답변

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, I have updated my answer.

작성자

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

작성자

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.

관련 게시물 답글 화면 활동
1
11월 15
6398
0
6월 25
630
1
5월 25
1461
2
5월 25
9914
3
3월 24
5578