diff --git a/addons/mail/i18n/mail.pot b/addons/mail/i18n/mail.pot
index e056c44d17b..82c906ef14c 100644
--- a/addons/mail/i18n/mail.pot
+++ b/addons/mail/i18n/mail.pot
@@ -3729,7 +3729,7 @@ msgstr ""
#. module: mail
#. openerp-web
-#: code:addons/mail/static/src/components/composer/composer.xml:0
+#: code:addons/mail/static/src/models/composer_view/composer_view.js:0
#: code:addons/mail/static/src/xml/web_kanban_activity.xml:0
#: code:addons/mail/static/src/xml/web_kanban_activity.xml:0
#: model_terms:ir.ui.view,arch_db:mail.email_compose_message_wizard_form
@@ -5898,7 +5898,7 @@ msgstr ""
#. module: mail
#. openerp-web
-#: code:addons/mail/static/src/components/composer/composer.xml:0
+#: code:addons/mail/static/src/models/composer_view/composer_view.js:0
#: model_terms:ir.ui.view,arch_db:mail.email_compose_message_wizard_form
#, python-format
msgid "Send"
diff --git a/addons/mail/static/src/components/composer/composer.xml b/addons/mail/static/src/components/composer/composer.xml
index 1e62f32b675..c703120cacd 100644
--- a/addons/mail/static/src/components/composer/composer.xml
+++ b/addons/mail/static/src/components/composer/composer.xml
@@ -153,8 +153,6 @@
diff --git a/addons/mail/static/src/components/composer/tests/composer_tests.js b/addons/mail/static/src/components/composer/tests/composer_tests.js
index f7675ba91d1..12bc14fb5ca 100644
--- a/addons/mail/static/src/components/composer/tests/composer_tests.js
+++ b/addons/mail/static/src/components/composer/tests/composer_tests.js
@@ -2141,6 +2141,23 @@ QUnit.test('[technical] does not crash when an attachment is removed before its
);
});
+QUnit.test('send button on mail.channel should have "Send" as label', async function (assert) {
+ assert.expect(1);
+
+ this.data['mail.channel'].records.push({ id: 20 });
+ const { createComposerComponent } = await this.start();
+ const thread = this.messaging.models['mail.thread'].findFromIdentifyingData({
+ id: 20,
+ model: 'mail.channel',
+ });
+ await createComposerComponent(thread.composer);
+ assert.strictEqual(
+ document.querySelector('.o_Composer_buttonSend').textContent,
+ "Send",
+ "Send button of mail.channel composer should have 'Send' as label",
+ );
+});
+
});
});
});
diff --git a/addons/mail/static/src/models/composer_view/composer_view.js b/addons/mail/static/src/models/composer_view/composer_view.js
index 6bce7914ec4..d1f60e766c9 100644
--- a/addons/mail/static/src/models/composer_view/composer_view.js
+++ b/addons/mail/static/src/models/composer_view/composer_view.js
@@ -546,6 +546,22 @@ function factory(dependencies) {
}
}
+ /**
+ * @private
+ * @returns {string}
+ */
+ _computeSendButtonText() {
+ if (
+ this.composer &&
+ this.composer.isLog &&
+ this.composer.activeThread &&
+ this.composer.activeThread.model !== 'mail.channel'
+ ) {
+ return this.env._t("Log");
+ }
+ return this.env._t("Send");
+ }
+
/**
* @private
* @returns {string}
@@ -931,6 +947,12 @@ function factory(dependencies) {
inverse: 'composerViewInEditing',
readonly: true,
}),
+ /**
+ * Determines the label on the send button of this composer view.
+ */
+ sendButtonText: attr({
+ compute: '_computeSendButtonText',
+ }),
/**
* States which type of suggestion is currently in progress, if any.
* The value of this field contains the magic char that corresponds to