[FIX] mail_compose_message: remove some keys from the context, as they conflict with mail_mail values.

bzr revid: tde@openerp.com-20130314110344-w5ashhs3jc1oslzp
This commit is contained in:
Thibault Delavallée 2013-03-14 12:03:44 +01:00
parent f4dbf7051b
commit 8a95e1886e
1 changed files with 4 additions and 0 deletions

View File

@ -234,6 +234,10 @@ class mail_compose_message(osv.TransientModel):
# automatically subscribe recipients if asked to
if context.get('mail_post_autofollow') and wizard.model and post_values.get('partner_ids'):
active_model_pool.message_subscribe(cr, uid, [res_id], [item[1] for item in post_values.get('partner_ids')], context=context)
# clean the context (hint: mass mailing sets some default values that
# could be wrongly interpreted by mail_mail)
context.pop('default_email_to', None)
context.pop('default_partner_ids', None)
# post the message
if mass_mail_mode and not wizard.post:
post_values['recipient_ids'] = post_values.pop('partner_ids')