Skip to Content
Menu
This question has been flagged
2 Replies
1232 Rodiniai

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

Portretas
Atmesti
Autorius Best Answer

Hello,

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

Best,

Portretas
Atmesti
Best Answer

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()

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
geg. 19
4550
0
bal. 21
2405
2
spal. 23
8726
1
geg. 19
5305
1
kov. 19
5485