diff options
| author | Olivier Dony <odo@openerp.com> | 2012-11-16 18:05:03 +0100 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2012-11-16 18:05:03 +0100 |
| commit | 01df612cd90be1eef3ce0395294270cd05ddd6fc (patch) | |
| tree | 04169b4a447215993cd2e59cca6ae362a695dfff /addons | |
| parent | 1829317730a3803e15fad557190b73fd36288d5c (diff) | |
[FIX] mail.compose.wizard: attachments should be m2m, body_text and content_subtype obsolete and removed
bzr revid: odo@openerp.com-20121116170503-mvsaa0pv5py2b7ri
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/mail/tests/test_mail.py | 2 | ||||
| -rw-r--r-- | addons/mail/tests/test_mail_access_rights.py | 8 | ||||
| -rw-r--r-- | addons/mail/wizard/mail_compose_message.py | 5 | ||||
| -rw-r--r-- | addons/mail/wizard/mail_compose_message_view.xml | 5 |
4 files changed, 10 insertions, 10 deletions
diff --git a/addons/mail/tests/test_mail.py b/addons/mail/tests/test_mail.py index 3e50618affe..a1873c336c0 100644 --- a/addons/mail/tests/test_mail.py +++ b/addons/mail/tests/test_mail.py @@ -504,8 +504,6 @@ class test_mail(test_mail_mockup.TestMailMockups): self.assertEqual(compose.parent_id and compose.parent_id.id, message.id, 'mail.message parent_id incorrect') # Test: mail.message: attachments for attach in compose.attachment_ids: - self.assertEqual(attach.res_model, 'mail.group', 'mail.message attachment res_model incorrect') - self.assertEqual(attach.res_id, self.group_pigs_id, 'mail.message attachment res_id incorrect') self.assertIn((attach.datas_fname, attach.datas.decode('base64')), _attachments_test, 'mail.message attachment name / data incorrect') # ---------------------------------------- diff --git a/addons/mail/tests/test_mail_access_rights.py b/addons/mail/tests/test_mail_access_rights.py index ec08d257efe..b8febc21064 100644 --- a/addons/mail/tests/test_mail_access_rights.py +++ b/addons/mail/tests/test_mail_access_rights.py @@ -21,6 +21,7 @@ from openerp.addons.mail.tests import test_mail_mockup from osv.orm import except_orm +from openerp.tools import mute_logger class test_mail_access_rights(test_mail_mockup.TestMailMockups): @@ -51,6 +52,7 @@ class test_mail_access_rights(test_mail_mockup.TestMailMockups): self.user_raoul = self.res_users.browse(cr, uid, self.user_raoul_id) self.partner_raoul_id = self.user_raoul.partner_id.id + @mute_logger('openerp.addons.base.ir.ir_model','openerp.osv.orm') def test_00_mail_message_search_access_rights(self): """ Test mail_message search override about access rights. """ cr, uid, group_pigs_id = self.cr, self.uid, self.group_pigs_id @@ -84,6 +86,7 @@ class test_mail_access_rights(test_mail_mockup.TestMailMockups): msg_ids = self.mail_message.search(cr, uid, [('subject', 'like', '_Test')]) self.assertEqual(set([msg_id1, msg_id2, msg_id3, msg_id4, msg_id5, msg_id6, msg_id7, msg_id8]), set(msg_ids), 'mail_message search failed') + @mute_logger('openerp.addons.base.ir.ir_model','openerp.osv.orm') def test_05_mail_message_read_access_rights(self): """ Test basic mail_message read access rights. """ cr, uid = self.cr, self.uid @@ -131,6 +134,7 @@ class test_mail_access_rights(test_mail_mockup.TestMailMockups): self.assertRaises(except_orm, self.mail_message.read, cr, user_bert_id, message_id) + @mute_logger('openerp.addons.base.ir.ir_model','openerp.osv.orm') def test_10_mail_flow_access_rights(self): """ Test a Chatter-looks alike flow. """ cr, uid = self.cr, self.uid @@ -178,14 +182,14 @@ class test_mail_access_rights(test_mail_mockup.TestMailMockups): # Do: Bert create a mail.compose.message record, because he uses the wizard compose_id = mail_compose.create(cr, user_bert_id, - {'subject': 'Subject', 'body_text': 'Body text', 'partner_ids': []}, + {'subject': 'Subject', 'body': 'Body text', 'partner_ids': []}, # {'subject': 'Subject', 'body_text': 'Body text', 'partner_ids': [(4, p_c_id), (4, p_d_id)]}, {'default_composition_mode': 'comment', 'default_model': 'mail.group', 'default_res_id': self.group_jobs_id}) mail_compose.send_mail(cr, user_bert_id, [compose_id]) self.user_demo_id = self.registry('ir.model.data').get_object_reference(self.cr, self.uid, 'base', 'user_demo')[1] compose_id = mail_compose.create(cr, self.user_demo_id, - {'subject': 'Subject', 'body_text': 'Body text', 'partner_ids': []}, + {'subject': 'Subject', 'body': 'Body text', 'partner_ids': []}, # {'subject': 'Subject', 'body_text': 'Body text', 'partner_ids': [(4, p_c_id), (4, p_d_id)]}, {'default_composition_mode': 'comment', 'default_model': 'mail.group', 'default_res_id': self.group_jobs_id}) mail_compose.send_mail(cr, self.user_demo_id, [compose_id]) diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index 694dc082bfe..8efc4cfbbf4 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -102,9 +102,8 @@ class mail_compose_message(osv.TransientModel): 'partner_ids': fields.many2many('res.partner', 'mail_compose_message_res_partner_rel', 'wizard_id', 'partner_id', 'Additional contacts'), - 'attachment_ids': fields.one2many('ir.attachment', 'res_id', - domain=lambda self: [('res_model', '=', self._name)], - string='Attachments'), + 'attachment_ids': fields.many2many('ir.attachment', 'mail_compose_message_ir_attachments_rel', + 'wizard_id', 'attachment_id', string='Attachments'), 'filter_id': fields.many2one('ir.filters', 'Filters'), } diff --git a/addons/mail/wizard/mail_compose_message_view.xml b/addons/mail/wizard/mail_compose_message_view.xml index 1711e09b2b7..57fc0aaf729 100644 --- a/addons/mail/wizard/mail_compose_message_view.xml +++ b/addons/mail/wizard/mail_compose_message_view.xml @@ -24,11 +24,10 @@ <field name="partner_ids" widget="many2many_tags_email" placeholder="Add contacts to notify..." context="{'force_email':True}" required="1"/> </div> - <field name="subject" placeholder="Subject..." - attrs="{'invisible':[('content_subtype', '=', 'plain')]}"/> + <field name="subject" placeholder="Subject..."/> </group> <field name="body"/> - <field name="attachment_ids" widget="one2many_binary" blockui="0"/> + <field name="attachment_ids" widget="many2many_binary"/> <footer> <button string="Send" name="send_mail" type="object" class="oe_highlight"/> or |
