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

Task-2793280

closes odoo/odoo#86440

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Alexandre Kühn
2022-03-21 14:00:41 +01:00
parent 0e7f90529e
commit 71775e32bb
3 changed files with 11 additions and 8 deletions
@@ -81,13 +81,6 @@ export class ComposerSuggestedRecipient extends Component {
));
}
/**
* @returns {string}
*/
get PLEASE_COMPLETE_CUSTOMER_S_INFORMATION() {
return this.env._t("Please complete customer's information");
}
/**
* @returns {SuggestedRecipientInfo}
*/
@@ -32,7 +32,7 @@
on_saved: _onDialogSaved,
res_id: false,
res_model: 'res.partner',
title: PLEASE_COMPLETE_CUSTOMER_S_INFORMATION,
title: suggestedRecipientInfo.dialogText,
}"
/>
</t>
@@ -7,6 +7,13 @@ registerModel({
name: 'SuggestedRecipientInfo',
identifyingFields: ['id'],
recordMethods: {
/**
* @private
* @returns {string}
*/
_computeDialogText() {
return this.env._t("Please complete customer's information");
},
/**
* Prevents selecting a recipient that does not have a partner.
*
@@ -25,6 +32,9 @@ registerModel({
},
},
fields: {
dialogText: attr({
compute: '_computeDialogText',
}),
/**
* Determines the email of `this`. It serves as visual clue when
* displaying `this`, and also serves as default partner email when