summaryrefslogtreecommitdiff
path: root/addons/plugin
diff options
context:
space:
mode:
authorThibault Delavallée <tde@openerp.com>2012-01-11 13:55:55 +0100
committerThibault Delavallée <tde@openerp.com>2012-01-11 13:55:55 +0100
commit7fd25b30f3a4ee8c33a67296b220a5bc8b34178f (patch)
tree6853a6d6b7241984ddb24e0a2f662429ad1a968f /addons/plugin
parent22d004658afc076662b0d41cf79a02a58d12bd63 (diff)
parent57bc6ec7d0819831a4b12dae95da04a774fe9335 (diff)
[MERGE] Merged with trunk addons
bzr revid: tde@openerp.com-20120111125555-04w1yb6ixiewz4yl
Diffstat (limited to 'addons/plugin')
-rw-r--r--addons/plugin/i18n/plugin.pot22
-rw-r--r--addons/plugin/plugin_handler.py13
2 files changed, 31 insertions, 4 deletions
diff --git a/addons/plugin/i18n/plugin.pot b/addons/plugin/i18n/plugin.pot
new file mode 100644
index 00000000000..ed95b4c18e8
--- /dev/null
+++ b/addons/plugin/i18n/plugin.pot
@@ -0,0 +1,22 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * plugin
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.1beta\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-12-22 18:46+0000\n"
+"PO-Revision-Date: 2011-12-22 18:46+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: plugin
+#: model:ir.model,name:plugin.model_plugin_handler
+msgid "plugin.handler"
+msgstr ""
+
diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py
index 8a9f2073c2d..ef990170e64 100644
--- a/addons/plugin/plugin_handler.py
+++ b/addons/plugin/plugin_handler.py
@@ -39,9 +39,9 @@ class plugin_handler(osv.osv_memory):
(model_name, res_id, url, name_get)
"""
mail_message_obj = self.pool.get('mail.message')
- model = False
+ model = ""
res_id = 0
- url = False
+ url = ""
name = ""
msg = mail_message_obj.parse_message(email)
references = [msg.get('message-id')]
@@ -54,7 +54,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.get(model).name_get(cr, uid, [res_id])[0][1]
return (model,res_id, url,name)
@@ -93,6 +93,7 @@ class plugin_handler(osv.osv_memory):
msg = mail_message.parse_message(email)
message_id = msg.get('message-id')
mail_ids = mail_message.search(cr, uid, [('message_id','=',message_id),('res_id','=',res_id),('model','=',model)])
+
if message_id and mail_ids :
mail_record = mail_message.browse(cr, uid, mail_ids)[0]
res_id = mail_record.res_id
@@ -104,8 +105,12 @@ class plugin_handler(osv.osv_memory):
res_id = model_obj.message_new(cr, uid, msg)
notify = "Mail succefully pushed, a new %s has been created " % model
else:
- model_obj.message_append_dict(cr, uid, [res_id], msg)
+ if model == 'res.partner':
+ model_obj = self.pool.get('mail.thread')
+ res = self.pool.get(model).browse(cr, uid, [res_id])
+ model_obj.message_append_dict(cr, uid, res, msg)
notify = "Mail succefully pushed"
+
url = self._make_url(cr, uid, res_id, model)
return (model, res_id, url, notify)