[MERGE] from trunk-mail-uploader-chm

bzr revid: chm@openerp.com-20121116151115-1u69yio8kb1h8fjd
This commit is contained in:
Christophe Matthieu
2012-11-16 16:11:15 +01:00
4 changed files with 6 additions and 7 deletions
@@ -102,6 +102,7 @@ class mail_compose_message(osv.TransientModel):
'datas_fname': attach_fname,
'res_model': model,
'res_id': res_id,
'type': 'binary', # overwrite the context default_value
}
values['attachment_ids'].append(ir_attach_obj.create(cr, uid, data_attach, context=context))
else:
+1 -3
View File
@@ -506,10 +506,8 @@ 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')
# ----------------------------------------
# CASE3: mass_mail on Pigs and Bird
# ----------------------------------------
+3 -3
View File
@@ -102,9 +102,9 @@ 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', 'Attachments'),
'filter_id': fields.many2one('ir.filters', 'Filters'),
'body_text': fields.text('Plain-text Contents'),
'content_subtype': fields.char('Message content subtype', size=32, readonly=1,
@@ -29,7 +29,7 @@
attrs="{'invisible':[('content_subtype', '=', 'plain')]}"/>
</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