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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project
- MRP
This question has been flagged
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
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
May 25
|
1117 | ||
|
2
May 25
|
1178 | ||
|
0
Apr 25
|
1015 | ||
|
1
Apr 25
|
1349 | ||
|
1
Mar 25
|
1455 |