[FIX] mail: Do not send log notes to customers

Issue

    - Install "CRM"
    - Create new lead
    - Set X to customer
    - Send a log note

    X receives log notes by mail

    Reproducible on Project and CRM

Cause

    The customer sends a list of partners who will receive an email
    even when it is a log note

Solution

    Send the list of partners only when it is an email and not a log note

opw-2369280

closes odoo/odoo#60855

X-original-commit: 4e660dfdf40a36eed7123bcea2452874238fddd8
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Achraf (abz)
2020-10-27 16:23:42 +00:00
parent 5b79e43ef0
commit 6f8d9ab39b
@@ -174,7 +174,7 @@ function factory(dependencies) {
*/
_computeRecipients() {
const recipients = [...this.mentionedPartners];
if (this.thread) {
if (this.thread && !this.isLog) {
for (const recipient of this.thread.suggestedRecipientInfoList) {
if (recipient.partner && recipient.isSelected) {
recipients.push(recipient.partner);
@@ -939,6 +939,7 @@ function factory(dependencies) {
recipients: many2many('mail.partner', {
compute: '_computeRecipients',
dependencies: [
'isLog',
'mentionedPartners',
'threadSuggestedRecipientInfoListIsSelected',
// FIXME thread.suggestedRecipientInfoList.partner should be a