summaryrefslogtreecommitdiff
path: root/odoo
diff options
context:
space:
mode:
authorDebauche Stéphane <std@odoo.com>2019-11-22 10:48:35 +0000
committerThibault Delavallée <tde@odoo.com>2020-02-26 15:12:03 +0000
commit991eb9a17b76c38e574d14caa56cfdfe47546399 (patch)
treeaacf9b0b19a0ce22d4247d7cb8a2b47892298d90 /odoo
parent232a00f11636bf2d2d811405036794376b8e0be5 (diff)
[FIX] sms: ensure chatter / SMS have the same content
When we send a SMS in the contact form view, exact body is sent by SMS and displayed in chatter. If some manual HTML is added chatter will display it as HTML while sms receive HTML tags. We want that the SMS content in the chatter is the same as the SMS sent and that HTML tags are removed to avoid being interpreted. To achieve that goal we call html2plaintext in ``_message_sms`` and in ``prepare_log_body_value`` that are two entry points to send SMS. We also update ``html2plaintext`` to strip result in order to avoid having unnecessary spaces left. Task ID 2126123 PR #40441 closes odoo/odoo#46362 X-original-commit: 4b7b14a5ea5e6ab521838c01813fa478154682fd Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'odoo')
-rw-r--r--odoo/tools/mail.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/tools/mail.py b/odoo/tools/mail.py
index 737afc8c39a..50467df606e 100644
--- a/odoo/tools/mail.py
+++ b/odoo/tools/mail.py
@@ -327,7 +327,7 @@ def html2plaintext(html, body_id=None, encoding='utf-8'):
html += '\n\n'
html += ustr('[%s] %s\n') % (i + 1, url)
- return html
+ return html.strip()
def plaintext2html(text, container_tag=False):
""" Convert plaintext into html. Content of the text is escaped to manage