Merge lp:~openerp-dev/openobject-addons/trunk-bug-1096395-kjo into lp:openobject-addons

Proposed by Kuldeep Joshi(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1096395-kjo
Merge into: lp:openobject-addons
Diff against target: 43 lines (+8/-3)
3 files modified
account/account_report.xml (+1/-1)
email_template/wizard/mail_compose_message.py (+6/-1)
mail/wizard/mail_compose_message.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1096395-kjo
Reviewer Review Type Date Requested Status
Atul Patel(OpenERP) Pending
Review via email: mp+142450@code.launchpad.net

Description of the change

Remove the attachment from mail_message_common and done at message_post method

To post a comment you must log in.

Unmerged revisions

8497. By Kuldeep Joshi(OpenERP)

[IMP] remove attachment from mail_compose_message and done at message_post time

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_report.xml'
2--- account/account_report.xml 2012-11-29 22:26:45 +0000
3+++ account/account_report.xml 2013-01-09 07:33:24 +0000
4@@ -19,7 +19,7 @@
5 name="account.invoice"
6 rml="account/report/account_print_invoice.rml"
7 string="Invoices"
8- attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
9+ attachment="(object.state in ('open','paid')) and ('Invoice_'+(object.number or '').replace('/','_')+'_.pdf')"
10 attachment_use="True"
11 usage="default"
12 />
13
14=== modified file 'email_template/wizard/mail_compose_message.py'
15--- email_template/wizard/mail_compose_message.py 2012-12-18 02:52:30 +0000
16+++ email_template/wizard/mail_compose_message.py 2013-01-09 07:33:24 +0000
17@@ -82,7 +82,12 @@
18 'res_id': res_id,
19 'type': 'binary', # override default_type from context, possibly meant for another model!
20 }
21- values['attachment_ids'].append(ir_attach_obj.create(cr, uid, data_attach, context=context))
22+ attach_ids = ir_attach_obj.search(cr, uid, [('name','=', attach_fname), ('res_model','=', model), ('res_id', '=',res_id)])
23+ if attach_ids:
24+ values['attachment_ids'].append(attach_ids[0])
25+ else:
26+ new_attach_id = ir_attach_obj.create(cr, uid, data_attach, context=context)
27+ values['attachment_ids'].append(new_attach_id)
28 else:
29 values = self.default_get(cr, uid, ['body', 'subject', 'partner_ids', 'attachment_ids'], context=context)
30
31
32=== modified file 'mail/wizard/mail_compose_message.py'
33--- mail/wizard/mail_compose_message.py 2012-12-21 09:59:02 +0000
34+++ mail/wizard/mail_compose_message.py 2013-01-09 07:33:24 +0000
35@@ -204,7 +204,7 @@
36 'body': wizard.body,
37 'parent_id': wizard.parent_id and wizard.parent_id.id,
38 'partner_ids': [(4, partner.id) for partner in wizard.partner_ids],
39- 'attachments': [(attach.datas_fname or attach.name, base64.b64decode(attach.datas)) for attach in wizard.attachment_ids],
40+ 'attachments': [],
41 }
42 # mass mailing: render and override default values
43 if mass_mail_mode and wizard.model:

Subscribers

People subscribed via source and target branches

to all changes: