[CLEAN] mail: removed modifications that have nothing to do with website in mail...
authorThibault Delavallée <tde@openerp.com>
Fri, 6 Dec 2013 10:17:16 +0000 (11:17 +0100)
committerThibault Delavallée <tde@openerp.com>
Fri, 6 Dec 2013 10:17:16 +0000 (11:17 +0100)
bzr revid: tde@openerp.com-20131206101716-08q6f4ufhj50e239

addons/email_template/wizard/mail_compose_message.py
addons/mail/static/src/js/mail.js
addons/mail/tests/common.py

index ac2f79b..4c1e19a 100644 (file)
@@ -42,12 +42,11 @@ class mail_compose_message(osv.TransientModel):
     _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'),
index b2d5e7e..269187d 100644 (file)
@@ -725,6 +725,7 @@ openerp.mail = function (session) {
             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, {
index b7a5a51..68a329e 100644 (file)
@@ -2,7 +2,7 @@
 ##############################################################################
 #
 #    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