_inherit = 'mail.compose.message'
def default_get(self, cr, uid, fields, context=None):
- """
- """
+ """ Override to pre-fill the data when having a template in single-email mode """
if context is None:
context = {}
res = super(mail_compose_message, self).default_get(cr, uid, fields, context=context)
- if context.get('default_template_id'):
+ if res.get('composition_mode') != 'mass_mail' and context.get('default_template_id'):
res.update(
self.onchange_template_id(
cr, uid, [], context['default_template_id'], res.get('composition_mode'),
var values = {
'body': this.$('textarea').val(),
'subject': false,
+ 'parent_id': this.context.default_parent_id,
'attachment_ids': _.map(this.attachment_ids, function (file) {return file.id;}),
'partner_ids': partner_ids,
'context': _.extend(this.parent_thread.context, {
##############################################################################
#
# OpenERP, Open Source Business Applications
-# Copyright (c) 20123TODAY OpenERP S.A. <http://www.openerp.com>
+# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as