Merge lp:~yann-papouin/openobject-addons/6.1-bug-1222859-mail-thread-wosubject into lp:openobject-addons/6.1

Proposed by Yann Papouin
Status: Needs review
Proposed branch: lp:~yann-papouin/openobject-addons/6.1-bug-1222859-mail-thread-wosubject
Merge into: lp:openobject-addons/6.1
Diff against target: 21 lines (+2/-2)
1 file modified
mail/mail_thread.py (+2/-2)
To merge this branch: bzr merge lp:~yann-papouin/openobject-addons/6.1-bug-1222859-mail-thread-wosubject
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+184728@code.launchpad.net

Description of the change

Add a subject string "(No subject)" to python dictionnary if no subject is parsed from the mail.

To post a comment you must log in.
7247. By Yann Papouin

Use (get) instead of (has_key + is not None)

Unmerged revisions

7247. By Yann Papouin

Use (get) instead of (has_key + is not None)

7246. By Yann Papouin

[FIX] Some e-mails cannot be imported if they don't have a subject

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 2012-08-10 11:48:38 +0000
3+++ mail/mail_thread.py 2013-10-10 09:03:04 +0000
4@@ -227,7 +227,7 @@
5 if not partner_id and thread._name == 'res.partner':
6 partner_id = thread.id
7 data = {
8- 'subject': subject,
9+ 'subject': subject or _('(No subject)'),
10 'user_id': uid,
11 'model' : thread._name,
12 'partner_id': partner_id,
13@@ -357,7 +357,7 @@
14 references = msg.get('references') or msg.get('in-reply-to')
15 match = tools.reference_re.search(references)
16 if match: res_id = match.group(1)
17- if not res_id:
18+ if not res_id and msg.get('subject'):
19 match = tools.res_re.search(msg['subject'])
20 if match: res_id = match.group(1)
21 if res_id: