Merge lp:~openerp-dev/openobject-addons/6.1-opw-587274-ado into lp:openobject-addons/6.1

Proposed by Amit Dodiya (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-587274-ado
Merge into: lp:openobject-addons/6.1
Diff against target: 19 lines (+9/-0)
1 file modified
mail/mail_thread.py (+9/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-587274-ado
Reviewer Review Type Date Requested Status
Xavier ALT Pending
Naresh(OpenERP) Pending
Review via email: mp+153060@code.launchpad.net

Description of the change

Hello,

[FIX] fetchmail creates record for all mail it should not create new record for replied mail

Steps:
1). Install fetchmail and crm_help desk
2). Configure the incoming mail server with crm_help desk object to create helpdesk request
3). Now fetch the new mail first from inbox then after send reply on that existing mail so the existing mail in inbpx contains the new reply and goes to unread
4). Now again fetch that mail that will create new helpdesk request instead of creating new message in existing helpdesk request

Regards,
Amit

To post a comment you must log in.
7184. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

7185. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

7186. By Amit Dodiya (OpenERP)

[FIX] fetchmail creates record for all mail it should not create new record for replied mail

Unmerged revisions

7186. By Amit Dodiya (OpenERP)

[FIX] fetchmail creates record for all mail it should not create new record for replied mail

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-03-15 11:41:21 +0000
4@@ -360,6 +360,15 @@
5 if not res_id:
6 match = tools.res_re.search(msg['subject'])
7 if match: res_id = match.group(1)
8+
9+ message_ids = []
10+ in_reply_to = msg.get('in-reply-to')
11+ if not res_id and in_reply_to:
12+ message_ids = mail_message.search(cr, uid, [('message_id', '=', in_reply_to)], limit=1, context=context)
13+ if message_ids:
14+ message = mail_message.browse(cr, uid, message_ids[0], context=context)
15+ res_id = message.res_id
16+
17 if res_id:
18 res_id = int(res_id)
19 if model_pool.exists(cr, uid, res_id) and hasattr(model_pool, 'message_update'):