[IMP] mail: turn 'Message/prettyBodyAsMarkup' to field

Task-2793280

closes odoo/odoo#86451

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Alexandre Kühn
2022-03-21 14:00:48 +01:00
parent d62e7d9af4
commit 5c5ef04aa3
3 changed files with 13 additions and 6 deletions
@@ -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}
*/
@@ -7,7 +7,7 @@
<b class="o_MessageInReplyToView_author text-muted ml-2">@<t t-esc="messageInReplyToView.messageView.message.parentMessage.authorName"/></b>
<span class="o_MessageInReplyToView_body ml-1" t-on-click="messageInReplyToView.onClickReply">
<t t-if="messageInReplyToView.hasBodyBackLink">
<t t-out="contentAsMarkup"/>
<t t-out="messageInReplyToView.messageView.message.parentMessage.prettyBodyAsMarkup"/>
</t>
<t t-if="messageInReplyToView.hasAttachmentBackLink">
<span class="font-italic mr-2">Click to see the attachments</span>
+11
View File
@@ -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',