summaryrefslogtreecommitdiff
path: root/addons/plugin/plugin_handler.py
diff options
context:
space:
mode:
authorRandhir Mayatra (OpenERP) <rma@tinyerp.com>2013-06-07 18:48:09 +0530
committerRandhir Mayatra (OpenERP) <rma@tinyerp.com>2013-06-07 18:48:09 +0530
commit66293ed61a7cbad4d6a1d47f79c6f45deace155c (patch)
treeb05fe35d29232a1ea357614a907fa56e75c056ea /addons/plugin/plugin_handler.py
parentff64d5a524612b9c9bb5d839e5c7e0834bcbdc88 (diff)
parent8c6ff33bef12cdfed35b15a90c3fd13bdd723b42 (diff)
[MERGE] merge with latest trunk
bzr revid: rma@tinyerp.com-20130607131809-iw2q151jg8kvbw2m
Diffstat (limited to 'addons/plugin/plugin_handler.py')
-rw-r--r--addons/plugin/plugin_handler.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py
index f13fc255a6d..fc6c874fab5 100644
--- a/addons/plugin/plugin_handler.py
+++ b/addons/plugin/plugin_handler.py
@@ -58,7 +58,7 @@ class plugin_handler(osv.osv_memory):
res_id = msg.res_id
model = msg.model
url = self._make_url(cr, uid, res_id, model)
- name = self.pool.get(model).name_get(cr, uid, [res_id])[0][1]
+ name = self.pool[model].name_get(cr, uid, [res_id])[0][1]
return (model, res_id, url, name)
def document_type(self, cr, uid, context=None):
@@ -82,7 +82,7 @@ class plugin_handler(osv.osv_memory):
@return : the result of name_search a list of tuple
[(id, 'name')]
"""
- return self.pool.get(model).name_search(cr, uid, name)
+ return self.pool[model].name_search(cr, uid, name)
def push_message(self, cr, uid, model, email, res_id=0):
"""
@@ -92,7 +92,7 @@ class plugin_handler(osv.osv_memory):
@return Dictionary which contain model , url and resource id.
"""
mail_message = self.pool.get('mail.message')
- model_obj = self.pool.get(model)
+ model_obj = self.pool[model]
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)])
@@ -110,7 +110,7 @@ class plugin_handler(osv.osv_memory):
model_obj.message_post(cr, uid, [res_id],
body=msg.get('body'),
subject=msg.get('subject'),
- type='email',
+ type='comment' if model == 'res.partner' else 'email',
parent_id=msg.get('parent_id'),
attachments=msg.get('attachments'))
notify = _("Mail successfully pushed")