summaryrefslogtreecommitdiff
path: root/addons/plugin
diff options
context:
space:
mode:
authorHarry (OpenERP) <hmo@tinyerp.com>2012-09-13 11:46:16 +0530
committerHarry (OpenERP) <hmo@tinyerp.com>2012-09-13 11:46:16 +0530
commit0efb0d57e7aa7f79e91ac759048edc1301be8eca (patch)
tree8a612880e635abd04057720b9e5d8fb5144a78bd /addons/plugin
parent635d3cf9649ca7b9fb27ec85eb0ddf6b3065802e (diff)
parent04f0a3f50fbb08086f28fbbe796d3201fb65320f (diff)
[MERGE] plugin issue
bzr revid: hmo@tinyerp.com-20120913061616-cnwe72xppx6hvevw
Diffstat (limited to 'addons/plugin')
-rw-r--r--addons/plugin/plugin_handler.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py
index 96d93afc025..8f0fdc1ad8e 100644
--- a/addons/plugin/plugin_handler.py
+++ b/addons/plugin/plugin_handler.py
@@ -44,7 +44,7 @@ class plugin_handler(osv.osv_memory):
res_id = 0
url = ""
name = ""
- msg = self.pool.get('mail.thread').parse_message(cr, uid, email)
+ msg = self.pool.get('mail.thread').message_parse(cr, uid, email)
references = [msg.get('message-id')]
refs = msg.get('references',False)
if refs:
@@ -91,7 +91,7 @@ class plugin_handler(osv.osv_memory):
"""
mail_message = self.pool.get('mail.message')
model_obj = self.pool.get(model)
- msg = self.pool.get('mail.thread').parse_message(cr, uid, email)
+ msg = self.pool.get('mail.thread').message_parse(cr, uid, email)
message_id = msg.get('message-id')
mail_ids = mail_message.search(cr, uid, [('message_id','=',message_id),('res_id','=',res_id),('model','=',model)])
@@ -104,17 +104,19 @@ class plugin_handler(osv.osv_memory):
notify = 'User the Partner button to create a new partner'
else:
res_id = model_obj.message_new(cr, uid, msg)
- notify = "Mail succesfully pushed, a new %s has been created " % model
+ notify = "Mail successfully pushed, a new %s has been created " % model
else:
- if model == 'res.partner':
- model_obj = self.pool.get('mail.thread')
- model_obj.message_post(cr, uid, [res_id], body=msg)
- notify = "Mail succesfully pushed"
-
+ model_obj.message_post(cr, uid, [res_id],
+ body= msg.get('body'),
+ subject= msg.get('subject'),
+ type= 'email',
+ parent_id= msg.get('parent_id'),
+ attachments= msg.get('attachments'))
+ notify = "Mail successfully pushed"
url = self._make_url(cr, uid, res_id, model)
return (model, res_id, url, notify)
- def contact_create(self, cr, uid, data, partner_id):
+ def contact_create(self, cr, uid, data, partner_id, context=None):
"""
@param data : the data use to create the res.partner
[('field_name', value)], field name is required
@@ -147,7 +149,7 @@ class plugin_handler(osv.osv_memory):
mail_message = self.pool.get('mail.message')
ir_attachment_obj = self.pool.get('ir.attachment')
attach_ids = []
- msg = self.pool.get('mail.thread').parse_message(cr, uid, headers)
+ msg = self.pool.get('mail.thread').message_parse(cr, uid, headers)
message_id = msg.get('message-id')
push_mail = self.push_message(cr, uid, model, headers, res_id)
res_id = push_mail[1]