diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index b41f1213791..66d8441e564 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -517,7 +517,9 @@ class mail_message(osv.osv): message.write({'state':'sent', 'message_id': res}) else: message.write({'state':'exception'}) - + model_pool = self.pool.get(message.model) + if hasattr(model_pool, '_hook_message_sent'): + model_pool._hook_message_sent(cr, uid, message.res_id, context=context) # if auto_delete=True then delete that sent messages as well as attachments message.refresh() if message.state == 'sent' and message.auto_delete: diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index e68bd70a739..2010d7d0f5a 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -100,6 +100,7 @@ class mail_compose_message(osv.osv_memory): if not result.get('email_from'): current_user = self.pool.get('res.users').browse(cr, uid, uid, context) result['email_from'] = current_user.user_email or False + result['subtype'] = 'html' return result _columns = { @@ -158,8 +159,9 @@ class mail_compose_message(osv.osv_memory): if not (subject.startswith('Re:') or subject.startswith(re_prefix)): subject = "%s %s" % (re_prefix, subject) result.update({ - 'subtype' : 'plain', # default to the text version due to quoting + 'subtype' : message_data.subtype or 'plain', # default to the text version due to quoting 'body_text' : body, + 'body_html' : message_data.body_html, 'subject' : subject, 'attachment_ids' : [], 'model' : message_data.model or False, @@ -238,7 +240,6 @@ class mail_compose_message(osv.osv_memory): subtype=mail.subtype, headers=headers, context=context) # in normal mode, we send the email immediately, as the user expects us to (delay should be sufficiently small) mail_message.send(cr, uid, [msg_id], context=context) - return {'type': 'ir.actions.act_window_close'} def render_template(self, cr, uid, template, model, res_id, context=None): diff --git a/addons/mail/wizard/mail_compose_message_view.xml b/addons/mail/wizard/mail_compose_message_view.xml index d559d679c8b..3a44b040139 100644 --- a/addons/mail/wizard/mail_compose_message_view.xml +++ b/addons/mail/wizard/mail_compose_message_view.xml @@ -23,6 +23,7 @@ +