summaryrefslogtreecommitdiff
path: root/addons/fetchmail
diff options
context:
space:
mode:
authorParth Gajjar (Open ERP) <pga@tinyerp.com>2013-05-08 18:16:39 +0530
committerParth Gajjar (Open ERP) <pga@tinyerp.com>2013-05-08 18:16:39 +0530
commit2c6aeae9112de0ec0d39f8cdbb0690747ecfaa77 (patch)
tree31ded50792f7f6fc6a9536c4d2d52e914a087c26 /addons/fetchmail
parent4ed6734b82f199952f672a812478b283342125ed (diff)
parent389f4911147b7cf5191b93e025c7b5c39d9e9eb6 (diff)
[MERGE]
bzr revid: pga@tinyerp.com-20130508124639-wfb2mpy15tnzs787
Diffstat (limited to 'addons/fetchmail')
-rw-r--r--addons/fetchmail/fetchmail.py28
-rw-r--r--addons/fetchmail/fetchmail_data.xml2
-rw-r--r--addons/fetchmail/i18n/cs.po335
3 files changed, 362 insertions, 3 deletions
diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py
index 4edba8cbe3c..cce1f77856e 100644
--- a/addons/fetchmail/fetchmail.py
+++ b/addons/fetchmail/fetchmail.py
@@ -34,7 +34,6 @@ import zipfile
import base64
from openerp import addons
-from openerp import netsvc
from openerp.osv import fields, osv
from openerp import tools
from openerp.tools.translate import _
@@ -90,7 +89,6 @@ class fetchmail_server(osv.osv):
'script': '/mail/static/scripts/openerp_mailgate.py',
}
-
def onchange_server_type(self, cr, uid, ids, server_type=False, ssl=False, object_id=False):
port = 0
values = {}
@@ -176,13 +174,14 @@ openerp_mailgate: "|/path/to/openerp-mailgate.py --host=localhost -u %(uid)d -p
def _fetch_mails(self, cr, uid, ids=False, context=None):
if not ids:
- ids = self.search(cr, uid, [('state','=','done')])
+ ids = self.search(cr, uid, [('state','=','done'),('type','in',['pop','imap'])])
return self.fetch_mail(cr, uid, ids, context=context)
def fetch_mail(self, cr, uid, ids, context=None):
"""WARNING: meant for cron usage only - will commit() after each email!"""
if context is None:
context = {}
+ context['fetchmail_cron_running'] = True
mail_thread = self.pool.get('mail.thread')
action_pool = self.pool.get('ir.actions.server')
for server in self.browse(cr, uid, ids, context=context):
@@ -241,6 +240,29 @@ 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 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)
+ 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)
+ return res
+
class mail_mail(osv.osv):
_inherit = "mail.mail"
_columns = {
diff --git a/addons/fetchmail/fetchmail_data.xml b/addons/fetchmail/fetchmail_data.xml
index d77aadc12de..3f6592b340f 100644
--- a/addons/fetchmail/fetchmail_data.xml
+++ b/addons/fetchmail/fetchmail_data.xml
@@ -10,6 +10,8 @@
<field name="model">fetchmail.server</field>
<field name="function">_fetch_mails</field>
<field name="args">()</field>
+ <!-- Active flag is set on fetchmail_server.create/write -->
+ <field name="active" eval="False"/>
</record>
</data>
</openerp>
diff --git a/addons/fetchmail/i18n/cs.po b/addons/fetchmail/i18n/cs.po
new file mode 100644
index 00000000000..78e00a1f982
--- /dev/null
+++ b/addons/fetchmail/i18n/cs.po
@@ -0,0 +1,335 @@
+# Czech translation for openobject-addons
+# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2012-12-21 17:05+0000\n"
+"PO-Revision-Date: 2013-03-27 09:03+0000\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: Czech <cs@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: 2013-03-28 04:41+0000\n"
+"X-Generator: Launchpad (build 16546)\n"
+
+#. module: fetchmail
+#: selection:fetchmail.server,state:0
+msgid "Confirmed"
+msgstr "Potvrzeno"
+
+#. module: fetchmail
+#: field:fetchmail.server,server:0
+msgid "Server Name"
+msgstr "Název serveru"
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "POP"
+msgstr "POP"
+
+#. module: fetchmail
+#: help:fetchmail.server,priority:0
+msgid "Defines the order of processing, lower values mean higher priority"
+msgstr "Určuje pořadí provádění, nižší hodnota znamená vyšší prioritu"
+
+#. module: fetchmail
+#: help:fetchmail.server,is_ssl:0
+msgid ""
+"Connections are encrypted with SSL/TLS through a dedicated port (default: "
+"IMAPS=993, POP3S=995)"
+msgstr ""
+"Přenos je zabezpečen certifikáty SSL/TSL a probíhá přes vyhrazené porty "
+"(standardně: IMAPS=993, POP3S=995)"
+
+#. module: fetchmail
+#: field:fetchmail.server,attach:0
+msgid "Keep Attachments"
+msgstr "Ponechat přílohy"
+
+#. module: fetchmail
+#: field:fetchmail.server,is_ssl:0
+msgid "SSL/TLS"
+msgstr "SSL/TLS"
+
+#. 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 ""
+"Mají-li být zahrnuty také originály každého e-mailu u zpracovávaných zpráv. "
+"To obvykle zdvojnásí velikost databáze zpráv."
+
+#. module: fetchmail
+#: view:base.config.settings:0
+msgid "Configure the incoming email gateway"
+msgstr "Nastavení příchozí poštovní brány"
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "Fetch Now"
+msgstr "Zkontrolovat"
+
+#. 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"
+msgstr "Servery příchozí pošty"
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "Server type IMAP."
+msgstr "IMAP server."
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "POP/IMAP Servers"
+msgstr "POP/IMAP servery"
+
+#. module: fetchmail
+#: selection:fetchmail.server,type:0
+msgid "Local Server"
+msgstr "Místní server"
+
+#. module: fetchmail
+#: field:fetchmail.server,state:0
+msgid "Status"
+msgstr "Stav"
+
+#. module: fetchmail
+#: model:ir.model,name:fetchmail.model_fetchmail_server
+msgid "POP/IMAP Server"
+msgstr "POP/IMAP server"
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "Reset Confirmation"
+msgstr "Obnovit potvrzení"
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "SSL"
+msgstr "SSL"
+
+#. module: fetchmail
+#: model:ir.model,name:fetchmail.model_fetchmail_config_settings
+msgid "fetchmail.config.settings"
+msgstr "fetchmail.config.settings"
+
+#. module: fetchmail
+#: field:fetchmail.server,date:0
+msgid "Last Fetch Date"
+msgstr "Poslední kontrola pošty"
+
+#. 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"
+msgstr ""
+"Volitelné vlastní akce serveru pro příchozí e-mail – na záznamu, který byl "
+"vytvořen nebo aktualizován tímto e-mailem."
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "# of emails"
+msgstr "# e-mailů"
+
+#. module: fetchmail
+#: field:fetchmail.server,original:0
+msgid "Keep Original"
+msgstr "Ponechat originál"
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "Advanced Options"
+msgstr "Rozšířené volby"
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+#: field:fetchmail.server,configuration:0
+msgid "Configuration"
+msgstr "Nastavení"
+
+#. module: fetchmail
+#: field:fetchmail.server,script:0
+msgid "Script"
+msgstr "Skript"
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "Incoming Mail Server"
+msgstr "Server příchozí pošty"
+
+#. module: fetchmail
+#: code:addons/fetchmail/fetchmail.py:164
+#, python-format
+msgid "Connection test failed!"
+msgstr "Tes připojení byl neúspěšný!"
+
+#. module: fetchmail
+#: field:fetchmail.server,user:0
+msgid "Username"
+msgstr "Uživatelské jméno"
+
+#. module: fetchmail
+#: help:fetchmail.server,server:0
+msgid "Hostname or IP of the mail server"
+msgstr "Název nebo IP adresa e-mail serveru"
+
+#. module: fetchmail
+#: field:fetchmail.server,name:0
+msgid "Name"
+msgstr "Název"
+
+#. module: fetchmail
+#: code:addons/fetchmail/fetchmail.py:164
+#, python-format
+msgid ""
+"Here is what we got instead:\n"
+" %s."
+msgstr ""
+"Bylo obdrženo namísto:\n"
+" %s."
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "Test & Confirm"
+msgstr "Test & Potvrzení"
+
+#. module: fetchmail
+#: field:fetchmail.server,action_id:0
+msgid "Server Action"
+msgstr "Akce serveru"
+
+#. module: fetchmail
+#: field:mail.mail,fetchmail_server_id:0
+msgid "Inbound Mail Server"
+msgstr "Server příchozí pošty"
+
+#. module: fetchmail
+#: field:fetchmail.server,message_ids:0
+#: model:ir.actions.act_window,name:fetchmail.act_server_history
+msgid "Messages"
+msgstr "Zprávy"
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "Search Incoming Mail Servers"
+msgstr "Hledat servery příchozí pošty"
+
+#. module: fetchmail
+#: field:fetchmail.server,active:0
+msgid "Active"
+msgstr "Aktivní"
+
+#. 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 ""
+"Mají-li být za zahrnuty také přílohy. Pokud nebude povoleno, budou příchozí "
+"e-maily zbaveny všech příloh před dalším zpracováním."
+
+#. module: fetchmail
+#: model:ir.model,name:fetchmail.model_mail_mail
+msgid "Outgoing Mails"
+msgstr "Odchozí e-maily"
+
+#. module: fetchmail
+#: field:fetchmail.server,priority:0
+msgid "Server Priority"
+msgstr "Priorita serveru"
+
+#. module: fetchmail
+#: selection:fetchmail.server,type:0
+msgid "IMAP Server"
+msgstr "IMAP server"
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "IMAP"
+msgstr "IMAP"
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "Server type POP."
+msgstr "POP server."
+
+#. module: fetchmail
+#: field:fetchmail.server,password:0
+msgid "Password"
+msgstr "Heslo"
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "Actions to Perform on Incoming Mails"
+msgstr "Akce prováděné s příchozími e-maily"
+
+#. module: fetchmail
+#: field:fetchmail.server,type:0
+msgid "Server Type"
+msgstr "Druh serveru"
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "Login Information"
+msgstr "Přihlašovací údaje"
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "Server Information"
+msgstr "Údaje o serveru"
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "If SSL required."
+msgstr "Je-li požádován SSL."
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "Advanced"
+msgstr "Rozšířené"
+
+#. module: fetchmail
+#: view:fetchmail.server:0
+msgid "Server & Login"
+msgstr "Server & Přihlášení"
+
+#. 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)."
+msgstr ""
+"Zpracuje každý příchozí e-mail jako součást konverzace podle druhu "
+"dokumentu. Buď se nové konverzaci se vytvoří nové dokumenty, nebo se ke "
+"stávající konverzaci připojí navazující e-maily (dokumenty)."
+
+#. module: fetchmail
+#: field:fetchmail.server,object_id:0
+msgid "Create a New Record"
+msgstr "Vytvořit nový záznam"
+
+#. module: fetchmail
+#: selection:fetchmail.server,state:0
+msgid "Not Confirmed"
+msgstr "Nepotvrzeno"
+
+#. module: fetchmail
+#: selection:fetchmail.server,type:0
+msgid "POP Server"
+msgstr "POP server"
+
+#. module: fetchmail
+#: field:fetchmail.server,port:0
+msgid "Port"
+msgstr "Port"