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?
Cette question a été signalée
1
Répondre
4936
Vues
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
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrire| Publications associées | Réponses | Vues | Activité | |
|---|---|---|---|---|
|
|
2
juin 26
|
1038 | ||
|
|
0
avr. 26
|
2 | ||
|
|
0
mars 26
|
134 | ||
|
|
0
mars 26
|
1060 | ||
|
|
3
mars 26
|
4097 |