Merge lp:~openerp-dev/openobject-addons/trunk-bug-1204608-dharmraj into lp:openobject-addons

Proposed by Pariket Trivedi(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1204608-dharmraj
Merge into: lp:openobject-addons
Diff against target: 21 lines (+2/-2)
1 file modified
mail/mail_thread.py (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1204608-dharmraj
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+200252@code.launchpad.net

Description of the change

hello all,

I have fixed issue when incoming e-mail is fetched with a special sign or other language attachments,
file are not properly display in cheater.

Thank you,
ptr

To post a comment you must log in.

Unmerged revisions

8854. By Pariket Trivedi(OpenERP)

[IMP] add condition check attachments filename is string so decode string.

8853. By Pariket Trivedi(OpenERP)

[MERGE]:merged with trunk.

8852. By Dharmraj Zala(OpenERP)

[FIX] attachments with special characters will be displayed properly

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mail/mail_thread.py'
2--- mail/mail_thread.py 2013-12-09 10:50:31 +0000
3+++ mail/mail_thread.py 2014-01-15 16:15:22 +0000
4@@ -1119,7 +1119,7 @@
5 encoding = part.get_content_charset() # None if attachment
6 # 1) Explicit Attachments -> attachments
7 if filename or part.get('content-disposition', '').strip().startswith('attachment'):
8- attachments.append((decode(filename) or 'attachment', part.get_payload(decode=True)))
9+ attachments.append((decode(filename) if isinstance(filename, str) else filename or 'attachment', part.get_payload(decode=True)))
10 continue
11 # 2) text/plain -> <pre/>
12 if part.get_content_type() == 'text/plain' and (not alternative or not body):
13@@ -1134,7 +1134,7 @@
14 body = tools.append_content_to_html(body, html, plaintext=False)
15 # 4) Anything else -> attachment
16 else:
17- attachments.append((filename or 'attachment', part.get_payload(decode=True)))
18+ attachments.append((decode(filename) if isinstance(filename, str) else filename or 'attachment', part.get_payload(decode=True)))
19 return body, attachments
20
21 def message_parse(self, cr, uid, message, save_original=False, context=None):

Subscribers

People subscribed via source and target branches

to all changes: