summaryrefslogtreecommitdiff
path: root/addons/plugin/plugin_handler.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/plugin/plugin_handler.py')
-rw-r--r--addons/plugin/plugin_handler.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py
index 94948d015c5..8b19d702872 100644
--- a/addons/plugin/plugin_handler.py
+++ b/addons/plugin/plugin_handler.py
@@ -109,8 +109,12 @@ class plugin_handler(osv.osv_memory):
notify = _("Mail successfully pushed, a new %s has been created.") % model
else:
email_from = msg.get('email_from')
- author_id = False if not email_from else \
- mail_thread_obj.message_find_partner_from_emails(cr, uid, [res_id], [email_from])[0].get('partner_id')
+ if email_from:
+ author_id = False
+ else:
+ authors = mail_thread_obj.message_find_partner_from_emails(cr, uid, [res_id], [email_from])
+ author_id = authors and authors[0].get('partner_id') or False
+
model_obj.message_post(cr, uid, [res_id],
body=msg.get('body'),
subject=msg.get('subject'),