コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3999 ビュー

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?

アバター
破棄
最善の回答

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

関連投稿 返信 ビュー 活動
3
9月 25
1835
2
9月 25
338
1
8月 25
1787
1
5月 25
1455
0
4月 25
1295