diff options
| author | Christophe Simonis <chs@odoo.com> | 2014-09-05 15:28:22 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2014-09-05 15:28:22 +0200 |
| commit | 31bf30d2d0eb78baaa36360b99fe58bf7cd4c9e7 (patch) | |
| tree | d7be61ecd6bb4c8b5552e39b03e2a64eebbbf323 /addons/fetchmail | |
| parent | afba9e8817c458640ae446ac7aaaab79be4fe1e9 (diff) | |
| parent | ed1c173971968eaa96693cb4e1547efa6e6c34e0 (diff) | |
[MERGE] forward port of branch 8.0 up to ed1c173
Diffstat (limited to 'addons/fetchmail')
| -rw-r--r-- | addons/fetchmail/__openerp__.py | 4 | ||||
| -rw-r--r-- | addons/fetchmail/fetchmail.py | 36 | ||||
| -rw-r--r-- | addons/fetchmail/i18n/fetchmail.pot | 268 |
3 files changed, 170 insertions, 138 deletions
diff --git a/addons/fetchmail/__openerp__.py b/addons/fetchmail/__openerp__.py index 84a26d5ec40..78bf093e6e4 100644 --- a/addons/fetchmail/__openerp__.py +++ b/addons/fetchmail/__openerp__.py @@ -54,10 +54,10 @@ same *conversation* document. For more specific needs, you may also assign custom-defined actions (technically: Server Actions) to be triggered for each incoming mail. """, - 'website': 'http://www.openerp.com', + 'website': 'https://www.odoo.com/page/mailing', 'data': [ - 'fetchmail_view.xml', 'fetchmail_data.xml', + 'fetchmail_view.xml', 'security/ir.model.access.csv', 'fetchmail_installer_view.xml' ], diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py index b496b8bca76..d0690520b0e 100644 --- a/addons/fetchmail/fetchmail.py +++ b/addons/fetchmail/fetchmail.py @@ -235,12 +235,12 @@ openerp_mailgate: "|/path/to/openerp-mailgate.py --host=localhost -u %(uid)d -p save_original=server.original, strip_attachments=(not server.attach), context=context) + pop_server.dele(num) except Exception: _logger.exception('Failed to process mail from %s server %s.', server.type, server.name) failed += 1 if res_id and server.action_id: action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids': [res_id], 'active_model': context.get("thread_model", server.object_id.model)}) - pop_server.dele(num) cr.commit() _logger.info("Fetched %d email(s) on %s server %s; %d succeeded, %d failed.", numMsgs, server.type, server.name, (numMsgs - failed), failed) except Exception: @@ -251,27 +251,33 @@ openerp_mailgate: "|/path/to/openerp-mailgate.py --host=localhost -u %(uid)d -p server.write({'date': time.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)}) return True - def cron_update(self, cr, uid, context=None): - if context is None: - context = {} - if not context.get('fetchmail_cron_running'): - # Enabled/Disable cron based on the number of 'done' server of type pop or imap - ids = self.search(cr, uid, [('state','=','done'),('type','in',['pop','imap'])]) - try: - cron_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'fetchmail', 'ir_cron_mail_gateway_action')[1] - self.pool.get('ir.cron').write(cr, 1, [cron_id], {'active': bool(ids)}) - except ValueError: - # Nevermind if default cron cannot be found - pass + def _update_cron(self, cr, uid, context=None): + if context and context.get('fetchmail_cron_running'): + return + + try: + cron = self.pool['ir.model.data'].get_object( + cr, uid, 'fetchmail', 'ir_cron_mail_gateway_action', context=context) + except ValueError: + # Nevermind if default cron cannot be found + return + + # Enabled/Disable cron based on the number of 'done' server of type pop or imap + cron.toggle(model=self._name, domain=[('state','=','done'), ('type','in',['pop','imap'])]) def create(self, cr, uid, values, context=None): res = super(fetchmail_server, self).create(cr, uid, values, context=context) - self.cron_update(cr, uid, context=context) + self._update_cron(cr, uid, context=context) return res def write(self, cr, uid, ids, values, context=None): res = super(fetchmail_server, self).write(cr, uid, ids, values, context=context) - self.cron_update(cr, uid, context=context) + self._update_cron(cr, uid, context=context) + return res + + def unlink(self, cr, uid, ids, context=None): + res = super(fetchmail_server, self).unlink(cr, uid, ids, context=context) + self._update_cron(cr, uid, context=context) return res class mail_mail(osv.osv): diff --git a/addons/fetchmail/i18n/fetchmail.pot b/addons/fetchmail/i18n/fetchmail.pot index c69359f71eb..b6b6253ce66 100644 --- a/addons/fetchmail/i18n/fetchmail.pot +++ b/addons/fetchmail/i18n/fetchmail.pot @@ -1,13 +1,13 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: # * fetchmail # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0alpha\n" +"Project-Id-Version: Odoo Server 8.0rc1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-12-21 17:05+0000\n" -"PO-Revision-Date: 2012-12-21 17:05+0000\n" +"POT-Creation-Date: 2014-08-14 13:09+0000\n" +"PO-Revision-Date: 2014-08-14 13:09+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -16,156 +16,175 @@ msgstr "" "Plural-Forms: \n" #. module: fetchmail -#: selection:fetchmail.server,state:0 -msgid "Confirmed" +#: view:fetchmail.server:fetchmail.view_email_server_tree +msgid "# of emails" msgstr "" #. module: fetchmail -#: field:fetchmail.server,server:0 -msgid "Server Name" +#: view:fetchmail.server:fetchmail.view_email_server_form +msgid "Actions to Perform on Incoming Mails" msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -msgid "POP" +#: field:fetchmail.server,active:0 +msgid "Active" msgstr "" #. module: fetchmail -#: help:fetchmail.server,priority:0 -msgid "Defines the order of processing, lower values mean higher priority" +#: view:fetchmail.server:fetchmail.view_email_server_form +msgid "Advanced" msgstr "" #. module: fetchmail -#: help:fetchmail.server,is_ssl:0 -msgid "Connections are encrypted with SSL/TLS through a dedicated port (default: IMAPS=993, POP3S=995)" +#: view:fetchmail.server:fetchmail.view_email_server_form +msgid "Advanced Options" msgstr "" #. module: fetchmail -#: field:fetchmail.server,attach:0 -msgid "Keep Attachments" +#: view:fetchmail.server:fetchmail.view_email_server_form +#: field:fetchmail.server,configuration:0 +msgid "Configuration" msgstr "" #. module: fetchmail -#: field:fetchmail.server,is_ssl:0 -msgid "SSL/TLS" +#: view:base.config.settings:fetchmail.inherit_view_general_configuration +msgid "Configure the incoming email gateway" msgstr "" #. module: fetchmail -#: help:fetchmail.server,original:0 -msgid "Whether a full original copy of each email should be kept for referenceand attached to each processed message. This will usually double the size of your message database." +#: selection:fetchmail.server,state:0 +msgid "Confirmed" msgstr "" #. module: fetchmail -#: view:base.config.settings:0 -msgid "Configure the incoming email gateway" +#: code:addons/fetchmail/fetchmail.py:163 +#, python-format +msgid "Connection test failed!" msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -msgid "Fetch Now" +#: help:fetchmail.server,is_ssl:0 +msgid "Connections are encrypted with SSL/TLS through a dedicated port (default: IMAPS=993, POP3S=995)" msgstr "" #. module: fetchmail -#: model:ir.actions.act_window,name:fetchmail.action_email_server_tree -#: model:ir.ui.menu,name:fetchmail.menu_action_fetchmail_server_tree -msgid "Incoming Mail Servers" +#: field:fetchmail.server,object_id:0 +msgid "Create a New Record" msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -msgid "Server type IMAP." +#: field:fetchmail.config.settings,create_uid:0 +#: field:fetchmail.server,create_uid:0 +msgid "Created by" msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -msgid "POP/IMAP Servers" +#: field:fetchmail.config.settings,create_date:0 +#: field:fetchmail.server,create_date:0 +msgid "Created on" msgstr "" #. module: fetchmail -#: selection:fetchmail.server,type:0 -msgid "Local Server" +#: help:fetchmail.server,priority:0 +msgid "Defines the order of processing, lower values mean higher priority" msgstr "" #. module: fetchmail -#: field:fetchmail.server,state:0 -msgid "Status" +#: view:fetchmail.server:fetchmail.view_email_server_form +msgid "Fetch Now" msgstr "" #. module: fetchmail -#: model:ir.model,name:fetchmail.model_fetchmail_server -msgid "POP/IMAP Server" +#: code:addons/fetchmail/fetchmail.py:163 +#, python-format +msgid "Here is what we got instead:\n" +" %s." msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -msgid "Reset Confirmation" +#: help:fetchmail.server,server:0 +msgid "Hostname or IP of the mail server" msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -msgid "SSL" +#: field:fetchmail.config.settings,id:0 +#: field:fetchmail.server,id:0 +msgid "ID" msgstr "" #. module: fetchmail -#: model:ir.model,name:fetchmail.model_fetchmail_config_settings -msgid "fetchmail.config.settings" +#: view:fetchmail.server:fetchmail.view_email_server_search +msgid "IMAP" msgstr "" #. module: fetchmail -#: field:fetchmail.server,date:0 -msgid "Last Fetch Date" +#: selection:fetchmail.server,type:0 +msgid "IMAP Server" msgstr "" #. module: fetchmail -#: help:fetchmail.server,action_id:0 -msgid "Optional custom server action to trigger for each incoming mail, on the record that was created or updated by this mail" +#: view:fetchmail.server:fetchmail.view_email_server_search +msgid "If SSL required." msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -msgid "# of emails" +#: field:mail.mail,fetchmail_server_id:0 +msgid "Inbound Mail Server" msgstr "" #. module: fetchmail -#: field:fetchmail.server,original:0 -msgid "Keep Original" +#: view:fetchmail.server:fetchmail.view_email_server_form +#: view:fetchmail.server:fetchmail.view_email_server_search +msgid "Incoming Mail Server" msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -msgid "Advanced Options" +#: model:ir.actions.act_window,name:fetchmail.action_email_server_tree +#: model:ir.ui.menu,name:fetchmail.menu_action_fetchmail_server_tree +msgid "Incoming Mail Servers" msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -#: field:fetchmail.server,configuration:0 -msgid "Configuration" +#: field:fetchmail.server,attach:0 +msgid "Keep Attachments" msgstr "" #. module: fetchmail -#: field:fetchmail.server,script:0 -msgid "Script" +#: field:fetchmail.server,original:0 +msgid "Keep Original" msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -msgid "Incoming Mail Server" +#: field:fetchmail.server,date:0 +msgid "Last Fetch Date" msgstr "" #. module: fetchmail -#: code:addons/fetchmail/fetchmail.py:155 -#, python-format -msgid "Connection test failed!" +#: field:fetchmail.config.settings,write_uid:0 +#: field:fetchmail.server,write_uid:0 +msgid "Last Updated by" msgstr "" #. module: fetchmail -#: field:fetchmail.server,user:0 -msgid "Username" +#: field:fetchmail.config.settings,write_date:0 +#: field:fetchmail.server,write_date:0 +msgid "Last Updated on" msgstr "" #. module: fetchmail -#: help:fetchmail.server,server:0 -msgid "Hostname or IP of the mail server" +#: selection:fetchmail.server,type:0 +msgid "Local Server" +msgstr "" + +#. module: fetchmail +#: view:fetchmail.server:fetchmail.view_email_server_form +msgid "Login Information" +msgstr "" + +#. module: fetchmail +#: field:fetchmail.server,message_ids:0 +#: model:ir.actions.act_window,name:fetchmail.act_server_history +msgid "Messages" msgstr "" #. module: fetchmail @@ -174,135 +193,142 @@ msgid "Name" msgstr "" #. module: fetchmail -#: code:addons/fetchmail/fetchmail.py:155 -#, python-format -msgid "Here is what we got instead:\n" -" %s." +#: selection:fetchmail.server,state:0 +msgid "Not Confirmed" msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -msgid "Test & Confirm" +#: help:fetchmail.server,action_id:0 +msgid "Optional custom server action to trigger for each incoming mail, on the record that was created or updated by this mail" msgstr "" #. module: fetchmail -#: field:fetchmail.server,action_id:0 -msgid "Server Action" +#: model:ir.model,name:fetchmail.model_mail_mail +msgid "Outgoing Mails" msgstr "" #. module: fetchmail -#: field:mail.mail,fetchmail_server_id:0 -msgid "Inbound Mail Server" +#: view:fetchmail.server:fetchmail.view_email_server_search +msgid "POP" msgstr "" #. module: fetchmail -#: field:fetchmail.server,message_ids:0 -#: model:ir.actions.act_window,name:fetchmail.act_server_history -msgid "Messages" +#: selection:fetchmail.server,type:0 +msgid "POP Server" msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -msgid "Search Incoming Mail Servers" +#: model:ir.model,name:fetchmail.model_fetchmail_server +msgid "POP/IMAP Server" msgstr "" #. module: fetchmail -#: field:fetchmail.server,active:0 -msgid "Active" +#: view:fetchmail.server:fetchmail.view_email_server_tree +msgid "POP/IMAP Servers" msgstr "" #. module: fetchmail -#: help:fetchmail.server,attach:0 -msgid "Whether attachments should be downloaded. If not enabled, incoming emails will be stripped of any attachments before being processed" +#: field:fetchmail.server,password:0 +msgid "Password" msgstr "" #. module: fetchmail -#: model:ir.model,name:fetchmail.model_mail_mail -msgid "Outgoing Mails" +#: field:fetchmail.server,port:0 +msgid "Port" msgstr "" #. module: fetchmail -#: field:fetchmail.server,priority:0 -msgid "Server Priority" +#: help:fetchmail.server,object_id:0 +msgid "Process each incoming mail as part of a conversation corresponding to this document type. This will create new documents for new conversations, or attach follow-up emails to the existing conversations (documents)." msgstr "" #. module: fetchmail -#: selection:fetchmail.server,type:0 -msgid "IMAP Server" +#: view:fetchmail.server:fetchmail.view_email_server_form +msgid "Reset Confirmation" msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -msgid "IMAP" +#: view:fetchmail.server:fetchmail.view_email_server_search +msgid "SSL" msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -msgid "Server type POP." +#: field:fetchmail.server,is_ssl:0 +msgid "SSL/TLS" msgstr "" #. module: fetchmail -#: field:fetchmail.server,password:0 -msgid "Password" +#: field:fetchmail.server,script:0 +msgid "Script" msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -msgid "Actions to Perform on Incoming Mails" +#: view:fetchmail.server:fetchmail.view_email_server_search +msgid "Search Incoming Mail Servers" msgstr "" #. module: fetchmail -#: field:fetchmail.server,type:0 -msgid "Server Type" +#: view:fetchmail.server:fetchmail.view_email_server_form +msgid "Server & Login" msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -msgid "Login Information" +#: field:fetchmail.server,action_id:0 +msgid "Server Action" msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 +#: view:fetchmail.server:fetchmail.view_email_server_form msgid "Server Information" msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -msgid "If SSL required." +#: field:fetchmail.server,server:0 +msgid "Server Name" msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -msgid "Advanced" +#: field:fetchmail.server,priority:0 +msgid "Server Priority" msgstr "" #. module: fetchmail -#: view:fetchmail.server:0 -msgid "Server & Login" +#: field:fetchmail.server,type:0 +msgid "Server Type" msgstr "" #. module: fetchmail -#: help:fetchmail.server,object_id:0 -msgid "Process each incoming mail as part of a conversation corresponding to this document type. This will create new documents for new conversations, or attach follow-up emails to the existing conversations (documents)." +#: view:fetchmail.server:fetchmail.view_email_server_search +msgid "Server type IMAP." msgstr "" #. module: fetchmail -#: field:fetchmail.server,object_id:0 -msgid "Create a New Record" +#: view:fetchmail.server:fetchmail.view_email_server_search +msgid "Server type POP." msgstr "" #. module: fetchmail -#: selection:fetchmail.server,state:0 -msgid "Not Confirmed" +#: field:fetchmail.server,state:0 +msgid "Status" msgstr "" #. module: fetchmail -#: selection:fetchmail.server,type:0 -msgid "POP Server" +#: view:fetchmail.server:fetchmail.view_email_server_form +msgid "Test & Confirm" msgstr "" #. module: fetchmail -#: field:fetchmail.server,port:0 -msgid "Port" +#: field:fetchmail.server,user:0 +msgid "Username" +msgstr "" + +#. module: fetchmail +#: help:fetchmail.server,original:0 +msgid "Whether a full original copy of each email should be kept for referenceand attached to each processed message. This will usually double the size of your message database." +msgstr "" + +#. module: fetchmail +#: help:fetchmail.server,attach:0 +msgid "Whether attachments should be downloaded. If not enabled, incoming emails will be stripped of any attachments before being processed" msgstr "" |
