[FIX] mail: add "To: No recipient" when there is no followers

task-3611153

closes odoo/odoo#148570

X-original-commit: 5f4f89a3573736c70c96e82d4cd12423a94ebb2e
Signed-off-by: Didier Debondt (did) <did@odoo.com>
This commit is contained in:
Didier (did)
2024-01-10 07:26:59 +00:00
parent b2a8ab359f
commit 3e00a3f633
4 changed files with 21 additions and 2 deletions
@@ -225,6 +225,9 @@ export class Chatter extends Component {
* @returns {string}
*/
get toRecipientsText() {
if (this.state.thread?.recipients.length === 0) {
return _t("No recipient");
}
const recipients = [...(this.state.thread?.recipients ?? [])]
.slice(0, 5)
.map(({ partner }) => {
+2 -2
View File
@@ -72,10 +72,10 @@
</button>
</div>
<t t-if="state.composerType">
<t t-if="state.composerType === 'message' and state.thread.recipients.length > 0">
<t t-if="state.composerType === 'message'">
<div class="flex-shrink-0 px-3 pt-3 text-truncate small mb-2" style="margin-left:48px">
<span class="fw-bold">To:</span> <t t-out="toRecipientsText"/>
<button class="o-mail-Chatter-recipientListButton btn btn-link badge rounded-pill border-0 p-1 ms-1" title="Show all recipients" t-on-click="onClickRecipientList">
<button t-if="state.thread.recipients.length > 0" class="o-mail-Chatter-recipientListButton btn btn-link badge rounded-pill border-0 p-1 ms-1" title="Show all recipients" t-on-click="onClickRecipientList">
<i class="fa fa-caret-down"/>
</button>
</div>