This question has been flagged

Hello All,

I send message on client email from CRM Lead and client replied this message in email.

Now i want to fetch this email in odoo system(in crm lead log note). So, what kinds of configuration and methods i need to apply?

Currently i setup outgoing and incoming email server and also override message_new method.

@api.model
    def message_new(self, msg, custom_values=None):
        create_context = dict(self.env.context or {})
        create_context['default_user_id'] = False

        defaults = {
            'name': msg.get('subject') or _("No Subject"),
            'email_from': msg.get('from'),
            'email_cc': msg.get('cc'),
            'partner_id': msg.get('author_id', False),
        }

        if custom_values:
            defaults.update(custom_values)

        res_id = super(CrmLead, self.with_context(create_context)).message_new(msg, custom_values=defaults)
        issue = self.browse(res_id)
        email_list = issue.email_split(msg)
        partner_ids = filter(None, issue._find_partner_from_emails(email_list))
        issue.message_subscribe(partner_ids)
        return res_id


Thanks in advance

Avatar
Discard