newid = super(mail_message, self).create(cr, uid, values, context)
if not values.get('subtype_id'):
return newid
-
self._notify(cr, uid, newid, context=context,
force_send=context.get('mail_notify_force_send', True),
user_signature=context.get('mail_notify_user_signature', True))
partners_to_notify -= set([message.author_id.id])
# all partner_ids of the mail.message have to be notified regardless of the above (even the author if explicitly added!)
- if message.subtype_id and message.partner_ids:
+ if message.partner_ids:
partners_to_notify |= set([p.id for p in message.partner_ids])
# notify
'use_active_domain': fields.boolean('Use active domain'),
'active_domain': fields.char('Active domain', readonly=True),
'notify': fields.boolean('Notify followers',
- help='Notify followers of the document'),
+ help='Notify followers of the document (mass post only)'),
'same_thread': fields.boolean('Replies in the document',
- help='Replies to the messages will go into the selected document.'),
+ help='Replies to the messages will go into the selected document (mass mail only)'),
'attachment_ids': fields.many2many('ir.attachment',
'mail_compose_message_ir_attachments_rel',
'wizard_id', 'attachment_id', 'Attachments'),
context.pop('default_email_to', None)
context.pop('default_partner_ids', None)
- active_ids = context.get('active_ids')
- is_log = context.get('mail_compose_log', False)
-
for wizard in self.browse(cr, uid, ids, context=context):
mass_mode = wizard.composition_mode in ('mass_mail', 'mass_post')
active_model_pool = self.pool[wizard.model if wizard.model else 'mail.thread']
# wizard works in batch mode: [res_id] or active_ids or active_domain
if mass_mode and wizard.use_active_domain and wizard.model:
res_ids = self.pool[wizard.model].search(cr, uid, eval(wizard.active_domain), context=context)
- elif mass_mode and wizard.model and active_ids:
- res_ids = active_ids
+ elif mass_mode and wizard.model and context.get('active_ids'):
+ res_ids = context['active_ids']
else:
res_ids = [wizard.res_id]
for res_id, mail_values in all_mail_values.iteritems():
if wizard.composition_mode == 'mass_mail':
- self.pool.get('mail.mail').create(cr, uid, mail_values, context=context)
+ self.pool['mail.mail'].create(cr, uid, mail_values, context=context)
else:
subtype = 'mail.mt_comment'
- if is_log or (wizard.composition_mode == 'mass_post' and not wizard.notify): # log a note: subtype is False
+ if context.get('mail_compose_log') or (wizard.composition_mode == 'mass_post' and not wizard.notify): # log a note: subtype is False
subtype = False
if wizard.composition_mode == 'mass_post':
context = dict(context,