diff options
| author | Frédéric van der Essen <fva@openerp.com> | 2012-11-14 15:17:51 +0100 |
|---|---|---|
| committer | Frédéric van der Essen <fva@openerp.com> | 2012-11-14 15:17:51 +0100 |
| commit | 25fb4bcbcaf4cb5804b7fd06761c3e0cf1f93ae6 (patch) | |
| tree | 1c2c40a5b016c8886d76ed0b79903ad83e756abc /addons/plugin | |
| parent | 8262b4fe9591f8c6d95fdbee1e11445370fbcd08 (diff) | |
| parent | fdf9f920f009a0d4a29c16b9755e9900b0eb705d (diff) | |
[MERGE] from trunk
bzr revid: fva@openerp.com-20121114141751-8l6meschr2ay4o6c
Diffstat (limited to 'addons/plugin')
| -rw-r--r-- | addons/plugin/i18n/ar.po | 4 | ||||
| -rw-r--r-- | addons/plugin/i18n/cs.po | 4 | ||||
| -rw-r--r-- | addons/plugin/i18n/de.po | 4 | ||||
| -rw-r--r-- | addons/plugin/i18n/es.po | 23 | ||||
| -rw-r--r-- | addons/plugin/i18n/es_CR.po | 4 | ||||
| -rw-r--r-- | addons/plugin/i18n/fi.po | 4 | ||||
| -rw-r--r-- | addons/plugin/i18n/fr.po | 4 | ||||
| -rw-r--r-- | addons/plugin/i18n/ja.po | 4 | ||||
| -rw-r--r-- | addons/plugin/i18n/mn.po | 4 | ||||
| -rw-r--r-- | addons/plugin/i18n/nb.po | 4 | ||||
| -rw-r--r-- | addons/plugin/i18n/nl.po | 6 | ||||
| -rw-r--r-- | addons/plugin/i18n/pt.po | 4 | ||||
| -rw-r--r-- | addons/plugin/i18n/pt_BR.po | 4 | ||||
| -rw-r--r-- | addons/plugin/i18n/ro.po | 4 | ||||
| -rw-r--r-- | addons/plugin/i18n/ru.po | 4 | ||||
| -rw-r--r-- | addons/plugin/i18n/sv.po | 4 | ||||
| -rw-r--r-- | addons/plugin/i18n/tr.po | 4 | ||||
| -rw-r--r-- | addons/plugin/i18n/zh_CN.po | 4 | ||||
| -rw-r--r-- | addons/plugin/i18n/zh_TW.po | 4 | ||||
| -rw-r--r-- | addons/plugin/plugin_handler.py | 36 |
20 files changed, 77 insertions, 56 deletions
diff --git a/addons/plugin/i18n/ar.po b/addons/plugin/i18n/ar.po index b1f7b0493b6..304fa4dbbf6 100644 --- a/addons/plugin/i18n/ar.po +++ b/addons/plugin/i18n/ar.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-08-28 06:43+0000\n" -"X-Generator: Launchpad (build 15864)\n" +"X-Launchpad-Export-Date: 2012-10-30 05:36+0000\n" +"X-Generator: Launchpad (build 16206)\n" #. module: plugin #: model:ir.model,name:plugin.model_plugin_handler diff --git a/addons/plugin/i18n/cs.po b/addons/plugin/i18n/cs.po index f111194587c..b11e9290cfd 100644 --- a/addons/plugin/i18n/cs.po +++ b/addons/plugin/i18n/cs.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-08-28 06:43+0000\n" -"X-Generator: Launchpad (build 15864)\n" +"X-Launchpad-Export-Date: 2012-10-30 05:36+0000\n" +"X-Generator: Launchpad (build 16206)\n" #. module: plugin #: model:ir.model,name:plugin.model_plugin_handler diff --git a/addons/plugin/i18n/de.po b/addons/plugin/i18n/de.po index 5a58bfe4530..6cd44e9275c 100644 --- a/addons/plugin/i18n/de.po +++ b/addons/plugin/i18n/de.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-08-28 06:43+0000\n" -"X-Generator: Launchpad (build 15864)\n" +"X-Launchpad-Export-Date: 2012-10-30 05:36+0000\n" +"X-Generator: Launchpad (build 16206)\n" #. module: plugin #: model:ir.model,name:plugin.model_plugin_handler diff --git a/addons/plugin/i18n/es.po b/addons/plugin/i18n/es.po new file mode 100644 index 00000000000..8111105ef1f --- /dev/null +++ b/addons/plugin/i18n/es.po @@ -0,0 +1,23 @@ +# Spanish translation for openobject-addons +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2012-02-08 00:36+0000\n" +"PO-Revision-Date: 2012-11-08 11:25+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Spanish <es@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-11-09 04:39+0000\n" +"X-Generator: Launchpad (build 16250)\n" + +#. module: plugin +#: model:ir.model,name:plugin.model_plugin_handler +msgid "plugin.handler" +msgstr "Manejador del plug-in" diff --git a/addons/plugin/i18n/es_CR.po b/addons/plugin/i18n/es_CR.po index d098e9119a3..6a9384281d8 100644 --- a/addons/plugin/i18n/es_CR.po +++ b/addons/plugin/i18n/es_CR.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-08-28 06:43+0000\n" -"X-Generator: Launchpad (build 15864)\n" +"X-Launchpad-Export-Date: 2012-10-30 05:36+0000\n" +"X-Generator: Launchpad (build 16206)\n" #. module: plugin #: model:ir.model,name:plugin.model_plugin_handler diff --git a/addons/plugin/i18n/fi.po b/addons/plugin/i18n/fi.po index 34bfb60ed62..0969989eab4 100644 --- a/addons/plugin/i18n/fi.po +++ b/addons/plugin/i18n/fi.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-08-28 06:43+0000\n" -"X-Generator: Launchpad (build 15864)\n" +"X-Launchpad-Export-Date: 2012-10-30 05:36+0000\n" +"X-Generator: Launchpad (build 16206)\n" #. module: plugin #: model:ir.model,name:plugin.model_plugin_handler diff --git a/addons/plugin/i18n/fr.po b/addons/plugin/i18n/fr.po index 6022403f59a..8ebc60f5970 100644 --- a/addons/plugin/i18n/fr.po +++ b/addons/plugin/i18n/fr.po @@ -15,8 +15,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-08-28 06:43+0000\n" -"X-Generator: Launchpad (build 15864)\n" +"X-Launchpad-Export-Date: 2012-10-30 05:36+0000\n" +"X-Generator: Launchpad (build 16206)\n" #. module: plugin #: model:ir.model,name:plugin.model_plugin_handler diff --git a/addons/plugin/i18n/ja.po b/addons/plugin/i18n/ja.po index 0ee81d3bac4..8ed0ad42d8f 100644 --- a/addons/plugin/i18n/ja.po +++ b/addons/plugin/i18n/ja.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-08-28 06:43+0000\n" -"X-Generator: Launchpad (build 15864)\n" +"X-Launchpad-Export-Date: 2012-10-30 05:36+0000\n" +"X-Generator: Launchpad (build 16206)\n" #. module: plugin #: model:ir.model,name:plugin.model_plugin_handler diff --git a/addons/plugin/i18n/mn.po b/addons/plugin/i18n/mn.po index 39484117214..1eff97d6d67 100644 --- a/addons/plugin/i18n/mn.po +++ b/addons/plugin/i18n/mn.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-08-28 06:43+0000\n" -"X-Generator: Launchpad (build 15864)\n" +"X-Launchpad-Export-Date: 2012-10-30 05:36+0000\n" +"X-Generator: Launchpad (build 16206)\n" #. module: plugin #: model:ir.model,name:plugin.model_plugin_handler diff --git a/addons/plugin/i18n/nb.po b/addons/plugin/i18n/nb.po index 0ef79314ec0..b366a19e06a 100644 --- a/addons/plugin/i18n/nb.po +++ b/addons/plugin/i18n/nb.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-09-11 04:50+0000\n" -"X-Generator: Launchpad (build 15924)\n" +"X-Launchpad-Export-Date: 2012-10-30 05:36+0000\n" +"X-Generator: Launchpad (build 16206)\n" #. module: plugin #: model:ir.model,name:plugin.model_plugin_handler diff --git a/addons/plugin/i18n/nl.po b/addons/plugin/i18n/nl.po index a8f4531f14b..8eece4e9fb3 100644 --- a/addons/plugin/i18n/nl.po +++ b/addons/plugin/i18n/nl.po @@ -9,13 +9,13 @@ msgstr "" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "POT-Creation-Date: 2012-02-08 00:36+0000\n" "PO-Revision-Date: 2012-02-14 13:02+0000\n" -"Last-Translator: Erwin <Unknown>\n" +"Last-Translator: Erwin van der Ploeg (Endian Solutions) <Unknown>\n" "Language-Team: Dutch <nl@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-08-28 06:43+0000\n" -"X-Generator: Launchpad (build 15864)\n" +"X-Launchpad-Export-Date: 2012-10-30 05:36+0000\n" +"X-Generator: Launchpad (build 16206)\n" #. module: plugin #: model:ir.model,name:plugin.model_plugin_handler diff --git a/addons/plugin/i18n/pt.po b/addons/plugin/i18n/pt.po index bc63e11c5f0..2570c0d83a4 100644 --- a/addons/plugin/i18n/pt.po +++ b/addons/plugin/i18n/pt.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-08-28 06:43+0000\n" -"X-Generator: Launchpad (build 15864)\n" +"X-Launchpad-Export-Date: 2012-10-30 05:36+0000\n" +"X-Generator: Launchpad (build 16206)\n" #. module: plugin #: model:ir.model,name:plugin.model_plugin_handler diff --git a/addons/plugin/i18n/pt_BR.po b/addons/plugin/i18n/pt_BR.po index 99e046c4de6..f5f5733227f 100644 --- a/addons/plugin/i18n/pt_BR.po +++ b/addons/plugin/i18n/pt_BR.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-08-28 06:43+0000\n" -"X-Generator: Launchpad (build 15864)\n" +"X-Launchpad-Export-Date: 2012-10-30 05:36+0000\n" +"X-Generator: Launchpad (build 16206)\n" #. module: plugin #: model:ir.model,name:plugin.model_plugin_handler diff --git a/addons/plugin/i18n/ro.po b/addons/plugin/i18n/ro.po index 8a17e29d6b2..0168cdc1395 100644 --- a/addons/plugin/i18n/ro.po +++ b/addons/plugin/i18n/ro.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-08-28 06:43+0000\n" -"X-Generator: Launchpad (build 15864)\n" +"X-Launchpad-Export-Date: 2012-10-30 05:36+0000\n" +"X-Generator: Launchpad (build 16206)\n" #. module: plugin #: model:ir.model,name:plugin.model_plugin_handler diff --git a/addons/plugin/i18n/ru.po b/addons/plugin/i18n/ru.po index bcdb2e75510..0bbdbe3e75c 100644 --- a/addons/plugin/i18n/ru.po +++ b/addons/plugin/i18n/ru.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-09-15 04:55+0000\n" -"X-Generator: Launchpad (build 15944)\n" +"X-Launchpad-Export-Date: 2012-10-30 05:36+0000\n" +"X-Generator: Launchpad (build 16206)\n" #. module: plugin #: model:ir.model,name:plugin.model_plugin_handler diff --git a/addons/plugin/i18n/sv.po b/addons/plugin/i18n/sv.po index 93341a27321..d53ce94d941 100644 --- a/addons/plugin/i18n/sv.po +++ b/addons/plugin/i18n/sv.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-08-28 06:43+0000\n" -"X-Generator: Launchpad (build 15864)\n" +"X-Launchpad-Export-Date: 2012-10-30 05:36+0000\n" +"X-Generator: Launchpad (build 16206)\n" #. module: plugin #: model:ir.model,name:plugin.model_plugin_handler diff --git a/addons/plugin/i18n/tr.po b/addons/plugin/i18n/tr.po index d51e6a4acd3..67f7bb21571 100644 --- a/addons/plugin/i18n/tr.po +++ b/addons/plugin/i18n/tr.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-08-28 06:43+0000\n" -"X-Generator: Launchpad (build 15864)\n" +"X-Launchpad-Export-Date: 2012-10-30 05:36+0000\n" +"X-Generator: Launchpad (build 16206)\n" #. module: plugin #: model:ir.model,name:plugin.model_plugin_handler diff --git a/addons/plugin/i18n/zh_CN.po b/addons/plugin/i18n/zh_CN.po index a874e49b529..330427c0ba9 100644 --- a/addons/plugin/i18n/zh_CN.po +++ b/addons/plugin/i18n/zh_CN.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-08-28 06:43+0000\n" -"X-Generator: Launchpad (build 15864)\n" +"X-Launchpad-Export-Date: 2012-10-30 05:36+0000\n" +"X-Generator: Launchpad (build 16206)\n" #. module: plugin #: model:ir.model,name:plugin.model_plugin_handler diff --git a/addons/plugin/i18n/zh_TW.po b/addons/plugin/i18n/zh_TW.po index 7b8f20da8cf..6a48ea718e8 100644 --- a/addons/plugin/i18n/zh_TW.po +++ b/addons/plugin/i18n/zh_TW.po @@ -14,8 +14,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-08-28 06:43+0000\n" -"X-Generator: Launchpad (build 15864)\n" +"X-Launchpad-Export-Date: 2012-10-30 05:36+0000\n" +"X-Generator: Launchpad (build 16206)\n" #. module: plugin #: model:ir.model,name:plugin.model_plugin_handler diff --git a/addons/plugin/plugin_handler.py b/addons/plugin/plugin_handler.py index 42754951317..95fe80f3b29 100644 --- a/addons/plugin/plugin_handler.py +++ b/addons/plugin/plugin_handler.py @@ -6,7 +6,6 @@ Created on 18 oct. 2011 from osv import osv, fields - class plugin_handler(osv.osv_memory): _name = 'plugin.handler' @@ -37,7 +36,7 @@ class plugin_handler(osv.osv_memory): @param email: email is a standard RFC2822 email message @return Dictionary which contain id and the model name of the document linked with the mail if no document is found the id = 0 - (model_name, res_id, url, name_get) + (model_name, res_id, url, name_get) """ mail_message_obj = self.pool.get('mail.message') model = "" @@ -52,7 +51,7 @@ class plugin_handler(osv.osv_memory): msg_ids = mail_message_obj.search(cr, uid, [('message_id','=', message_id)]) msg_id = len(msg_ids) and msg_ids[0] or False if not msg_id and parent_id: - msg_id = parent_id + msg_id = parent_id if msg_id: msg = mail_message_obj.browse(cr, uid, msg_id) res_id = msg.res_id @@ -61,7 +60,6 @@ class plugin_handler(osv.osv_memory): name = self.pool.get(model).name_get(cr, uid, [res_id])[0][1] return (model,res_id, url,name) - def document_type(self, cr, uid, context=None): """ Return the list of available model to push @@ -74,13 +72,13 @@ class plugin_handler(osv.osv_memory): doc_dict['res.partner'] = "Partner" return doc_dict.items() - # Can be used where search record was used + # Can be used where search record was used def list_document_get(self, cr, uid, model, name): """ This function return the result of name_search on the object model - @param model: the name of the model + @param model: the name of the model @param : the name of the document - @return : the result of name_search a list of tuple + @return : the result of name_search a list of tuple [(id, 'name')] """ return self.pool.get(model).name_search(cr, uid, name) @@ -89,7 +87,7 @@ class plugin_handler(osv.osv_memory): """ @param email: email is a standard RFC2822 email message @param model: On which model the message is pushed - @param thread_id: on which document the message is pushed, if thread_id = 0 a new document is created + @param thread_id: on which document the message is pushed, if thread_id = 0 a new document is created @return Dictionary which contain model , url and resource id. """ mail_message = self.pool.get('mail.message') @@ -97,7 +95,7 @@ class plugin_handler(osv.osv_memory): 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)]) - + if message_id and mail_ids : mail_record = mail_message.browse(cr, uid, mail_ids)[0] res_id = mail_record.res_id @@ -109,11 +107,11 @@ class plugin_handler(osv.osv_memory): res_id = model_obj.message_process(cr, uid, model, email) notify = "Mail successfully pushed, a new %s has been created " % model else: - model_obj.message_post(cr, uid, [res_id], - body= msg.get('body'), - subject= msg.get('subject'), - type= 'email', - parent_id= msg.get('parent_id'), + 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) @@ -123,7 +121,7 @@ class plugin_handler(osv.osv_memory): """ @param data : the data use to create the res.partner [('field_name', value)], field name is required - @param partner_id : On which partner the address is attached + @param partner_id : On which partner the address is attached if partner_id = 0 then create a new partner with the same name that the address @return : the partner_id sended or created, this allow the plugin to open the right partner page """ @@ -138,7 +136,7 @@ class plugin_handler(osv.osv_memory): return ('res.partner', partner_id, url) # Specific to outlook rfc822 is not available so we split in arguments headerd,body,attachemnts - def push_message_outlook(self, cr, uid, model, headers,res_id=0 ,body=False, body_html=False, attachments=False): + def push_message_outlook(self, cr, uid, model, headers, res_id=0, body=False, body_html=False, attachments=False): # ---------------------------------------- # solution 1 # construct a fake rfc822 from the separated arguement @@ -149,14 +147,14 @@ class plugin_handler(osv.osv_memory): # solution 2 # use self.pushmessage only with header and body # add attachemnt yourself after - mail_message = self.pool.get('mail.message') + mail_message = self.pool.get('mail.message') ir_attachment_obj = self.pool.get('ir.attachment') attach_ids = [] msg = self.pool.get('mail.thread').message_parse(cr, uid, headers) - message_id = msg.get('message-id') + message_id = msg.get('message-id') push_mail = self.push_message(cr, uid, model, headers, res_id) res_id = push_mail[1] - model = push_mail[0] + model = push_mail[0] for name in attachments.keys(): attachment_ids = ir_attachment_obj.search(cr, uid, [('res_model', '=', model), ('res_id', '=', res_id), ('datas_fname', '=', name)]) if attachment_ids: |
