In website support model (Odoo 12), when I close ticket I have to write a message to send it through email. Then, this message will post in the chatter, but I'm receiving this:
I've tried using regex, to clean the html tags, but still the comment came with tags.
class WebsiteSupportTicketClose(models.TransientModel):
_inherit = "website.support.ticket.close"
def close_ticket(self):
# ... code
clean_message = self.cleanhtml(self.message)
print(clean_message)
self.ticket_id.close_comment = clean_message
# code ...
def cleanhtml(self, raw_html):
cleanr = re.compile('<.*?>')
cleantext = re.sub(cleanr, '', raw_html)
return cleantext
In the prints, I can see that clean_message variable is formatted without tags, but when I assigned this to self.ticket_id.close_comment is adding the tags.
How can I delete the tags?
question from:
https://stackoverflow.com/questions/65851234/clean-html-body-tags-in-chatter 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…