Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
1213 Переглядів

Hello,

Any idea how to make the followers of a sales order or invoice visible to all the recipients. 

It´s happening that a follower is forwarding the email to another follower, since they don´t see all the recipients included in the loop.

Thanks,

Mireia

Аватар
Відмінити
Автор Найкраща відповідь

Hello,

I don´t use codes... can this be done with Studio?

Best,

Аватар
Відмінити
Найкраща відповідь

code to get all followers' emails
---------------------------------

followers = self.env['mail.followers'].search([('res_model', '=', 'sale.order'), ('res_id', '=', sale_order_id)])

emails = [follower.partner_id.email for follower in followers]


Add these emails to the Cc field
----------------------------------

email_values = {

    'subject': 'Sales Order Notification',

    'email_to': main_recipient_email,

    'email_cc': ','.join(emails),

    # other email parameters

}


mail = self.env['mail.mail'].create(email_values)

mail.send()

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
трав. 19
4535
0
квіт. 21
2393
2
жовт. 23
8701
1
трав. 19
5262
1
бер. 19
5478