From 99064105fd06b7a85252a71ea4e631290351dcf7 Mon Sep 17 00:00:00 2001 From: "vta vta@openerp.com" <> Date: Thu, 29 Nov 2012 14:17:01 +0100 Subject: [PATCH] [FIX] Now when sending a SO also add as followers all recipients, not only the customer. bzr revid: vta@openerp.com-20121129131701-t8o121dzujs8r2pd --- addons/portal_sale/sale.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/portal_sale/sale.py b/addons/portal_sale/sale.py index aa8b6e57689..79fcbdef6fd 100644 --- a/addons/portal_sale/sale.py +++ b/addons/portal_sale/sale.py @@ -51,8 +51,13 @@ class mail_mail(osv.osv): if mail.model == 'sale.order': so_obj = self.pool.get('sale.order') partner = so_obj.browse(cr, uid, mail.res_id, context=context)['partner_id'] + # Add the customer in the SO as follower if partner.id not in so_obj.browse(cr, uid, mail.res_id, context=context)['message_follower_ids']: so_obj.message_subscribe(cr, uid, [mail.res_id], [partner.id], context=context) + # Add all recipients of the email as followers + for p in mail.partner_ids: + if p.id not in so_obj.browse(cr, uid, mail.res_id, context=context)['message_follower_ids']: + so_obj.message_subscribe(cr, uid, [mail.res_id], [p.id], context=context) return super(mail_mail, self)._postprocess_sent_message(cr, uid, mail=mail, context=context) mail_mail() \ No newline at end of file