From 96dd64e31f02410e6bd94096463d423450b3591b Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 17 Apr 2013 10:14:10 +0200 Subject: [PATCH] [REVERT] mail: undo model-level change that can cause issue for stable deployments Failing to force a manual update of the mail module would cause all composer wizards to display html contents without the WYSIWYG editor, making it mostly unusable for regular users. Users are not expected to always force an update of all modules after updating to the latest source code. bzr revid: odo@openerp.com-20130417081410-dwc33ymizlihvbng --- addons/email_template/tests/test_mail.py | 2 +- addons/mail/wizard/mail_compose_message.py | 7 ------- addons/mail/wizard/mail_compose_message_view.xml | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/addons/email_template/tests/test_mail.py b/addons/email_template/tests/test_mail.py index 68ddbe7dbbd..a4ecb9b6f91 100644 --- a/addons/email_template/tests/test_mail.py +++ b/addons/email_template/tests/test_mail.py @@ -155,7 +155,7 @@ class test_message_compose(TestMailBase): message_pids = [partner.id for partner in compose.partner_ids] partner_ids = [p_a_id] self.assertEqual(compose.subject, '${object.name}', 'mail.compose.message subject incorrect') - self.assertEqual(compose.body, '${object.description}', 'mail.compose.message body incorrect') + self.assertEqual(compose.body, '

${object.description}

', 'mail.compose.message body incorrect') self.assertEqual(set(message_pids), set(partner_ids), 'mail.compose.message partner_ids incorrect') # 2. Post the comment, get created message diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index 3a12920c951..301dff515b3 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -116,13 +116,6 @@ class mail_compose_message(osv.TransientModel): 'mail_compose_message_ir_attachments_rel', 'wizard_id', 'attachment_id', 'Attachments'), 'filter_id': fields.many2one('ir.filters', 'Filters'), - - # Replace `body` with a text field because html fields are sanitized - # just before saving data into the database. This cause the - # sanitization of the templated messages (for mass mailing messages) - # before the rendering, forbidding the use of templated html links. - # The html of the message will be sanitized by message_post() - 'body': fields.text('Contents'), } _defaults = { diff --git a/addons/mail/wizard/mail_compose_message_view.xml b/addons/mail/wizard/mail_compose_message_view.xml index 73c16713718..00ba33a6d6f 100644 --- a/addons/mail/wizard/mail_compose_message_view.xml +++ b/addons/mail/wizard/mail_compose_message_view.xml @@ -30,7 +30,7 @@ - +