[REVERT] mail: undo model-level change that can cause issue for stable deployments
authorOlivier Dony <odo@openerp.com>
Wed, 17 Apr 2013 08:14:10 +0000 (10:14 +0200)
committerOlivier Dony <odo@openerp.com>
Wed, 17 Apr 2013 08:14:10 +0000 (10:14 +0200)
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
addons/mail/wizard/mail_compose_message.py
addons/mail/wizard/mail_compose_message_view.xml

index 68ddbe7..a4ecb9b 100644 (file)
@@ -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, '<p>${object.description}</p>', '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
index 3a12920..301dff5 100644 (file)
@@ -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 = {
index 73c1671..00ba33a 100644 (file)
@@ -30,7 +30,7 @@
                         </div>
                         <field name="subject" placeholder="Subject..."/>
                     </group>
-                    <field name="body" widget='html'/>
+                    <field name="body"/>
                     <field name="attachment_ids" widget="many2many_binary"/>
                     <footer>
                         <button string="Send" name="send_mail" type="object" class="oe_highlight"/>