Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
1388 มุมมอง

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
4761
0
เม.ย. 21
2535
2
ต.ค. 23
8955
1
พ.ค. 19
5437
1
มี.ค. 19
5707