Merge lp:~openerp-dev/openobject-addons/7.0-opw-593990-rgo into lp:openobject-addons/7.0

Proposed by Ravi Gohil (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-593990-rgo
Merge into: lp:openobject-addons/7.0
Diff against target: 16 lines (+5/-1)
1 file modified
plugin/plugin_handler.py (+5/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-593990-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+200276@code.launchpad.net

Description of the change

Hello,

When try to create OpenERP document for some model using OE Thunderbird plugin, the document isn't being created instead a message is created of the source email.

Steps to reproduce issue:
1) Configure an email account, say <email address hidden>, in thunderbird email client,
2) Create a db in OE and configure the alias(tinyerp.com) and change the alias of admin user to <email address hidden>,
3) Login with admin user in thunderbird client using the plugin,
4) Create a document, say Lead/Opportunity, using "Create Document" button from menu "OpenERP/Documents" for any incoming email to <email address hidden>,

Expected Result: A new lead should be created with the contact details fetched from the source email and user should be presented with the new lead in the default browser.

Current Result: New lead isn't being created and a blank form view of the lead object is presented in the browser.

The root cause of this bug is that, when creating any email the message is processed using the message_process(...) which has generic routing logic. But, when creating any document, specially using OE thunderbird or Outlook plugin, the routing is not required at all. Hence I fixed the issue by modifying the code within the plugin handler.

Kindly review the fix.

Thanks.

To post a comment you must log in.
9728. By Ravi Gohil (OpenERP)

[FIX] Creation of documents using OE thunderbird plugin does not work if an direct alias match found in OpenERP instance from particular email's headers. (Maintenance Case: 593990)

Unmerged revisions

9728. By Ravi Gohil (OpenERP)

[FIX] Creation of documents using OE thunderbird plugin does not work if an direct alias match found in OpenERP instance from particular email's headers. (Maintenance Case: 593990)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugin/plugin_handler.py'
2--- plugin/plugin_handler.py 2013-04-29 13:05:57 +0000
3+++ plugin/plugin_handler.py 2014-01-02 13:39:24 +0000
4@@ -104,7 +104,11 @@
5 if model == 'res.partner':
6 notify = _('Use the Partner button to create a new partner')
7 else:
8- res_id = model_obj.message_process(cr, uid, model, email)
9+ c = dict(mail_create_nolog=True, mail_create_nosubscribe=True)
10+ if self._name == 'mail.thread':
11+ c.update(thread_model=model)
12+ res_id = model_obj.message_new(cr, uid, msg, context=c)
13+ model_obj.message_post(cr, uid, [res_id], context=c, subtype='mail.mt_comment', **msg)
14 notify = _("Mail successfully pushed, a new %s has been created.") % model
15 else:
16 model_obj.message_post(cr, uid, [res_id],