Skip to content
Snippets Groups Projects
Commit e55ec3c8 authored by Alexandre Kühn's avatar Alexandre Kühn
Browse files

[IMP] mail: turn 'SuggestedRecipientInfo/titleText' into field


Task-2793280

closes odoo/odoo#86439

Signed-off-by: default avatarAlexandre Kühn (aku) <aku@odoo.com>
parent 2b1719ff
Branches
Tags
No related merge requests found
......@@ -68,19 +68,6 @@ export class ComposerSuggestedRecipient extends Component {
// Public
//--------------------------------------------------------------------------
/**
* @returns {string|undefined}
*/
get ADD_AS_RECIPIENT_AND_FOLLOWER_REASON() {
if (!this.suggestedRecipientInfo) {
return undefined;
}
return this.env._t(_.str.sprintf(
"Add as recipient and follower (reason: %s)",
this.suggestedRecipientInfo.reason
));
}
/**
* @returns {SuggestedRecipientInfo}
*/
......
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="mail.ComposerSuggestedRecipient" owl="1">
<div class="o_ComposerSuggestedRecipient" t-attf-class="{{ className }}" t-att-data-partner-id="suggestedRecipientInfo and suggestedRecipientInfo.partner and suggestedRecipientInfo.partner.id ? suggestedRecipientInfo.partner.id : false" t-att-title="ADD_AS_RECIPIENT_AND_FOLLOWER_REASON" t-ref="root">
<div class="o_ComposerSuggestedRecipient" t-attf-class="{{ className }}" t-att-data-partner-id="suggestedRecipientInfo and suggestedRecipientInfo.partner and suggestedRecipientInfo.partner.id ? suggestedRecipientInfo.partner.id : false" t-att-title="suggestedRecipientInfo and suggestedRecipientInfo.titleText" t-ref="root">
<t t-if="suggestedRecipientInfo">
<div class="custom-control custom-checkbox">
<input t-attf-id="{{ id }}_checkbox" class="custom-control-input" type="checkbox" t-att-checked="suggestedRecipientInfo.isSelected ? 'checked' : undefined" t-on-change="_onChangeCheckbox" t-ref="checkbox" />
......
......@@ -3,6 +3,8 @@
import { registerModel } from '@mail/model/model_core';
import { attr, one } from '@mail/model/model_field';
import { sprintf } from '@web/core/utils/strings';
registerModel({
name: 'SuggestedRecipientInfo',
identifyingFields: ['id'],
......@@ -30,6 +32,16 @@ registerModel({
_computeName() {
return this.partner && this.partner.nameOrDisplayName || this.name;
},
/**
* @private
* @returns {string}
*/
_computeTitleText() {
return sprintf(
this.env._t("Add as recipient and follower (reason: %s)"),
this.reason
);
},
},
fields: {
dialogText: attr({
......@@ -88,5 +100,8 @@ registerModel({
inverse: 'suggestedRecipientInfoList',
required: true,
}),
titleText: attr({
compute: '_computeTitleText',
}),
},
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment