[FIX] im_livechat: keep line breaks on feedback message

Before this commit, line breaks where removed from the
feedback message at the end of a livechat session.

This commit fixes this issue.

part of task-3332872

closes odoo/odoo#126925

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
tsm-odoo
2023-06-30 11:58:06 +02:00
parent c0ae4f59de
commit 389f794ec5
+2 -1
View File
@@ -1,6 +1,7 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from markupsafe import Markup
import re
from werkzeug.exceptions import NotFound
from odoo import http, tools, _
@@ -174,7 +175,7 @@ class LivechatController(http.Controller):
'reason': reason,
}
channel.message_post(
body=body,
body=Markup(re.sub(r'\r\n|\r|\n', '<br>', body)),
message_type='notification',
subtype_xmlid='mail.mt_comment'
)