[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
This commit is contained in:
Nicolas Lempereur
2018-03-16 16:26:26 +01:00
parent 0030be1571
commit 18a5a7a935
+3 -1
View File
@@ -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)