[MERGE] from trunk-bug-1075501-vta
authorChristophe Matthieu <chm@openerp.com>
Thu, 6 Dec 2012 12:43:28 +0000 (13:43 +0100)
committerChristophe Matthieu <chm@openerp.com>
Thu, 6 Dec 2012 12:43:28 +0000 (13:43 +0100)
bzr revid: chm@openerp.com-20121206124328-o063xc0w2tavbmik

1  2 
addons/mail/mail_message.py
addons/mail/wizard/invite.py

Simple merge
@@@ -68,9 -68,13 +68,11 @@@ class invite_wizard(osv.osv_memory)
              # filter partner_ids to get the new followers, to avoid sending email to already following partners
              new_follower_ids = [p.id for p in wizard.partner_ids if p.id not in document.message_follower_ids]
              model_obj.message_subscribe(cr, uid, [wizard.res_id], new_follower_ids, context=context)
 -
 +            
              # send an email
              if wizard.message:
+                 # the invite wizard should create a private message not related to any object,
 -                # we ensure that by removing default res_id and res_model from the context
 -                context.pop('default_res_id', False)
 -                context.pop('default_model', False)
++                # we ensure that by overwriting off res_id and res_model default value of the context
                  for follower_id in new_follower_ids:
                      mail_mail = self.pool.get('mail.mail')
                      mail_id = mail_mail.create(cr, uid, {