Normally the mail body from a incoming lead mail (POP3) is stored into the chatter messagebox. How can I store it in the description field in crm.lead?
Esta pergunta foi sinalizada
1
Responder
4908
Visualizações
Override
def message_new(self, msg_dict, custom_values=None):
method in the crm.lead model
Check this for reference: https://github.com/odoo/odoo/blob/12.0/addons/project/models/project.py#L847
I managed it another way:
body = remove_html_tags(self.message_ids[0].body)
self.description = body
def remove_html_tags(text):
"""Remove html tags from a string"""
import re
clean = re.compile('<.*?>')
return re.sub(clean, '', text)
You can use `from odoo.tools import html2plaintext` to remove tags
Está gostando da discussão? Não fique apenas lendo, participe!
Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!
Inscrever-se| Publicações relacionadas | Respostas | Visualizações | Atividade | |
|---|---|---|---|---|
|
|
2
jun. 26
|
948 | ||
|
|
0
abr. 26
|
2 | ||
|
|
0
mar. 26
|
134 | ||
|
|
0
mar. 26
|
1030 | ||
|
|
3
mar. 26
|
4074 |