From 0cf14852a3cf615c11b3abd478669dbf9824d1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Wed, 2 Dec 2020 14:00:21 +0000 Subject: [PATCH] [FIX] mail: remove html from new message notification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit task-2388659 closes odoo/odoo#62756 X-original-commit: 8af59b95b477b2eeddec118663e21b00a4e48801 Signed-off-by: Alexandre Kühn (aku) Signed-off-by: Sébastien Theys (seb) --- .../messaging_notification_handler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/mail/static/src/models/messaging_notification_handler/messaging_notification_handler.js b/addons/mail/static/src/models/messaging_notification_handler/messaging_notification_handler.js index 69f2969090d..2fdc59cae18 100644 --- a/addons/mail/static/src/models/messaging_notification_handler/messaging_notification_handler.js +++ b/addons/mail/static/src/models/messaging_notification_handler/messaging_notification_handler.js @@ -3,6 +3,7 @@ odoo.define('mail/static/src/models/messaging_notification_handler/messaging_not const { registerNewModel } = require('mail/static/src/model/model_core.js'); const { one2one } = require('mail/static/src/model/model_field.js'); +const { htmlToTextContentInline } = require('mail.utils'); const PREVIEW_MSG_MAX_SIZE = 350; // optimal for native English speakers @@ -748,7 +749,7 @@ function factory(dependencies) { notificationTitle = owl.utils.escape(authorName); } } - const notificationContent = message.prettyBody.substr(0, PREVIEW_MSG_MAX_SIZE); + const notificationContent = htmlToTextContentInline(message.body).substr(0, PREVIEW_MSG_MAX_SIZE); this.env.services['bus_service'].sendNotification(notificationTitle, notificationContent); messaging.update({ outOfFocusUnreadMessageCounter: messaging.outOfFocusUnreadMessageCounter + 1 }); const titlePattern = messaging.outOfFocusUnreadMessageCounter === 1