From 5c5ef04aa31453995b03c9f00bad2e374a9cdab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Tue, 15 Mar 2022 13:20:32 +0000 Subject: [PATCH] [IMP] mail: turn 'Message/prettyBodyAsMarkup' to field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-2793280 closes odoo/odoo#86451 Signed-off-by: Alexandre Kühn (aku) --- .../message_in_reply_to_view.js | 6 +----- .../message_in_reply_to_view.xml | 2 +- addons/mail/static/src/models/message.js | 11 +++++++++++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/addons/mail/static/src/components/message_in_reply_to_view/message_in_reply_to_view.js b/addons/mail/static/src/components/message_in_reply_to_view/message_in_reply_to_view.js index 0a009aaf1b4..43ae85f72c6 100644 --- a/addons/mail/static/src/components/message_in_reply_to_view/message_in_reply_to_view.js +++ b/addons/mail/static/src/components/message_in_reply_to_view/message_in_reply_to_view.js @@ -2,14 +2,10 @@ import { registerMessagingComponent } from '@mail/utils/messaging_component'; -const { Component, markup } = owl; +const { Component } = owl; export class MessageInReplyToView extends Component { - get contentAsMarkup() { - return markup(this.messageInReplyToView.messageView.message.parentMessage.prettyBody); - } - /** * @returns {MessageInReplyToView} */ diff --git a/addons/mail/static/src/components/message_in_reply_to_view/message_in_reply_to_view.xml b/addons/mail/static/src/components/message_in_reply_to_view/message_in_reply_to_view.xml index 30773f5a43b..480e96ba061 100644 --- a/addons/mail/static/src/components/message_in_reply_to_view/message_in_reply_to_view.xml +++ b/addons/mail/static/src/components/message_in_reply_to_view/message_in_reply_to_view.xml @@ -7,7 +7,7 @@ @ - + Click to see the attachments diff --git a/addons/mail/static/src/models/message.js b/addons/mail/static/src/models/message.js index 96b19cbea5f..0c08b5611c1 100644 --- a/addons/mail/static/src/models/message.js +++ b/addons/mail/static/src/models/message.js @@ -11,6 +11,8 @@ import { session } from '@web/session'; import { format } from 'web.field_utils'; import { getLangDatetimeFormat, str_to_datetime } from 'web.time'; +const { markup } = owl; + registerModel({ name: 'Message', identifyingFields: ['id'], @@ -575,6 +577,12 @@ registerModel({ } return this.date.format('hh:mm'); }, + /** + * @returns {Markup} + */ + _computePrettyBodyAsMarkup() { + return markup(this.prettyBody); + }, /** * @private * @returns {Thread[]} @@ -903,6 +911,9 @@ registerModel({ compute: '_computePrettyBody', default: "", }), + prettyBodyAsMarkup: attr({ + compute: '_computePrettyBodyAsMarkup', + }), recipients: many('Partner'), shortTime: attr({ compute: '_computeShortTime',