From 18a5a7a9358dc19a737694172f469966d46bbc68 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 16 Mar 2018 14:01:50 +0100 Subject: [PATCH] [FIX] portal: show line return in chatter message In the frontend only plaintext is saved without any javascript fiddling so in the controller it should be adapted to be saved. With this change, the behavior is more similar to backend chatter which sends html (processed by javascript) to the server. opw-1817918 closes #23706 --- addons/portal/controllers/mail.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/portal/controllers/mail.py b/addons/portal/controllers/mail.py index b8ff6f8f2fd..9fb2c6b94ac 100644 --- a/addons/portal/controllers/mail.py +++ b/addons/portal/controllers/mail.py @@ -6,7 +6,7 @@ from werkzeug.exceptions import NotFound, Forbidden from odoo import http from odoo.http import request from odoo.osv import expression -from odoo.tools import consteq +from odoo.tools import consteq, plaintext2html def _has_token_access(res_model, res_id, token=''): @@ -59,6 +59,8 @@ class PortalChatter(http.Controller): def portal_chatter_post(self, res_model, res_id, message, **kw): url = request.httprequest.referrer if message: + # message is received in plaintext and saved in html + message = plaintext2html(message) _message_post_helper(res_model, int(res_id), message, **kw) url = url + "#discussion" return request.redirect(url)