[FIX] Now when sending a SO also add as followers all recipients, not only the customer.

bzr revid: vta@openerp.com-20121129131701-t8o121dzujs8r2pd
This commit is contained in:
vta vta@openerp.com 2012-11-29 14:17:01 +01:00
parent 63ab1dd18c
commit 99064105fd
1 changed files with 5 additions and 0 deletions

View File

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