Run pre-commit (black, isort)

This commit is contained in:
Guewen Baconnier 2020-01-28 11:49:20 +01:00 committed by Marcos Oitaben
parent e27bffa1fb
commit a5ba449ea6
12 changed files with 74 additions and 145 deletions

View File

@ -14,13 +14,13 @@ Mail configuration with server_environment
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github
:target: https://github.com/OCA/server-env/tree/12.0/mail_environment
:target: https://github.com/OCA/server-env/tree/13.0/mail_environment
:alt: OCA/server-env
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-env-12-0/server-env-12-0-mail_environment
:target: https://translation.odoo-community.org/projects/server-env-13-0/server-env-13-0-mail_environment
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/254/12.0
:target: https://runbot.odoo-community.org/runbot/254/13.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@ -103,7 +103,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-env/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-env/issues/new?body=module:%20mail_environment%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/server-env/issues/new?body=module:%20mail_environment%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@ -138,6 +138,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/server-env <https://github.com/OCA/server-env/tree/12.0/mail_environment>`_ project on GitHub.
This module is part of the `OCA/server-env <https://github.com/OCA/server-env/tree/13.0/mail_environment>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -3,7 +3,7 @@
{
"name": "Mail configuration with server_environment",
"version": "13.0.1.0.0",
"version": "13.0.1.0.1",
"category": "Tools",
"summary": "Configure mail servers with server_environment_files",
"author": "Camptocamp, Odoo Community Association (OCA)",

View File

@ -19,22 +19,11 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: mail_environment
#: selection:fetchmail.server,type:0
#, fuzzy
msgid "IMAP Server"
msgstr "POP/IMAP-Server"
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_fetchmail_server
msgid "Incoming Mail Server"
msgstr ""
#. module: mail_environment
#: selection:fetchmail.server,type:0
msgid "Local Server"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_ir_mail_server
#, fuzzy
@ -42,12 +31,14 @@ msgid "Mail Server"
msgstr "ir.mail_server"
#. module: mail_environment
#: selection:fetchmail.server,type:0
#, fuzzy
msgid "POP Server"
msgstr "POP/IMAP-Server"
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__type
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_type
msgid "Server Type"
msgstr ""
#, fuzzy
#~ msgid "IMAP Server"
#~ msgstr "POP/IMAP-Server"
#, fuzzy
#~ msgid "POP Server"
#~ msgstr "POP/IMAP-Server"

View File

@ -18,21 +18,11 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: mail_environment
#: selection:fetchmail.server,type:0
msgid "IMAP Server"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_fetchmail_server
msgid "Incoming Mail Server"
msgstr ""
#. module: mail_environment
#: selection:fetchmail.server,type:0
msgid "Local Server"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_ir_mail_server
#, fuzzy
@ -40,11 +30,6 @@ msgid "Mail Server"
msgstr "ir.mail_server"
#. module: mail_environment
#: selection:fetchmail.server,type:0
msgid "POP Server"
msgstr ""
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__type
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_type
msgid "Server Type"
msgstr ""

View File

@ -20,22 +20,11 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#. module: mail_environment
#: selection:fetchmail.server,type:0
#, fuzzy
msgid "IMAP Server"
msgstr "POP/IMAP Server"
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_fetchmail_server
msgid "Incoming Mail Server"
msgstr ""
#. module: mail_environment
#: selection:fetchmail.server,type:0
msgid "Local Server"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_ir_mail_server
#, fuzzy
@ -43,12 +32,14 @@ msgid "Mail Server"
msgstr "ir.mail_server"
#. module: mail_environment
#: selection:fetchmail.server,type:0
#, fuzzy
msgid "POP Server"
msgstr "POP/IMAP Server"
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__type
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_type
msgid "Server Type"
msgstr ""
#, fuzzy
#~ msgid "IMAP Server"
#~ msgstr "POP/IMAP Server"
#, fuzzy
#~ msgid "POP Server"
#~ msgstr "POP/IMAP Server"

View File

@ -1,45 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_environment
# * mail_environment
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\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: mail_environment
#: selection:fetchmail.server,type:0
msgid "IMAP Server"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_fetchmail_server
msgid "Incoming Mail Server"
msgstr ""
#. module: mail_environment
#: selection:fetchmail.server,type:0
msgid "Local Server"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_ir_mail_server
msgid "Mail Server"
msgstr ""
#. module: mail_environment
#: selection:fetchmail.server,type:0
msgid "POP Server"
msgstr ""
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__type
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_type
msgid "Server Type"
msgstr ""

View File

@ -10,8 +10,8 @@ msgstr ""
"POT-Creation-Date: 2015-09-29 11:14+0000\n"
"PO-Revision-Date: 2019-09-03 01:23+0000\n"
"Last-Translator: Rodrigo Macedo <rmsolucoeseminformatic4@gmail.com>\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/"
"OCA-server-tools-8-0/language/pt_BR/)\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-server-"
"tools-8-0/language/pt_BR/)\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -19,32 +19,26 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 3.8\n"
#. module: mail_environment
#: selection:fetchmail.server,type:0
msgid "IMAP Server"
msgstr "Servidor IMAP"
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_fetchmail_server
msgid "Incoming Mail Server"
msgstr "Servidor de Mensagens Recebidas"
#. module: mail_environment
#: selection:fetchmail.server,type:0
msgid "Local Server"
msgstr "Servidor Local"
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_ir_mail_server
msgid "Mail Server"
msgstr "Servidor de E-mail"
#. module: mail_environment
#: selection:fetchmail.server,type:0
msgid "POP Server"
msgstr "Servidor POP"
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__type
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_type
msgid "Server Type"
msgstr "Tipo de Servidor"
#~ msgid "IMAP Server"
#~ msgstr "Servidor IMAP"
#~ msgid "Local Server"
#~ msgstr "Servidor Local"
#~ msgid "POP Server"
#~ msgstr "Servidor POP"

View File

@ -20,22 +20,11 @@ msgstr ""
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3);\n"
#. module: mail_environment
#: selection:fetchmail.server,type:0
#, fuzzy
msgid "IMAP Server"
msgstr "POP/IMAP strežnik"
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_fetchmail_server
msgid "Incoming Mail Server"
msgstr ""
#. module: mail_environment
#: selection:fetchmail.server,type:0
msgid "Local Server"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_ir_mail_server
#, fuzzy
@ -43,12 +32,14 @@ msgid "Mail Server"
msgstr "ir.mail_server"
#. module: mail_environment
#: selection:fetchmail.server,type:0
#, fuzzy
msgid "POP Server"
msgstr "POP/IMAP strežnik"
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__type
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_type
msgid "Server Type"
msgstr ""
#, fuzzy
#~ msgid "IMAP Server"
#~ msgstr "POP/IMAP strežnik"
#, fuzzy
#~ msgid "POP Server"
#~ msgstr "POP/IMAP strežnik"

View File

@ -19,22 +19,11 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
#. module: mail_environment
#: selection:fetchmail.server,type:0
#, fuzzy
msgid "IMAP Server"
msgstr "POP/IMAP 服务器"
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_fetchmail_server
msgid "Incoming Mail Server"
msgstr ""
#. module: mail_environment
#: selection:fetchmail.server,type:0
msgid "Local Server"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_ir_mail_server
#, fuzzy
@ -42,12 +31,14 @@ msgid "Mail Server"
msgstr "POP/IMAP 服务器"
#. module: mail_environment
#: selection:fetchmail.server,type:0
#, fuzzy
msgid "POP Server"
msgstr "POP/IMAP 服务器"
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__type
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_type
msgid "Server Type"
msgstr ""
#, fuzzy
#~ msgid "IMAP Server"
#~ msgstr "POP/IMAP 服务器"
#, fuzzy
#~ msgid "POP Server"
#~ msgstr "POP/IMAP 服务器"

View File

@ -2,12 +2,14 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
import operator
from odoo import api, fields, models
class FetchmailServer(models.Model):
"""Incoming POP/IMAP mail server account"""
_name = 'fetchmail.server'
_name = "fetchmail.server"
_inherit = ["fetchmail.server", "server.env.mixin"]
@property
@ -26,7 +28,7 @@ class FetchmailServer(models.Model):
mail_fields.update(base_fields)
return mail_fields
server_type = fields.Selection(search='_search_server_type')
server_type = fields.Selection(search="_search_server_type")
@api.model
def _server_env_global_section_name(self):
@ -34,19 +36,19 @@ class FetchmailServer(models.Model):
Can be customized in your model
"""
return 'incoming_mail'
return "incoming_mail"
@api.model
def _search_type(self, oper, value):
operators = {
'=': operator.eq,
'!=': operator.ne,
'in': operator.contains,
'not in': lambda a, b: not operator.contains(a, b),
"=": operator.eq,
"!=": operator.ne,
"in": operator.contains,
"not in": lambda a, b: not operator.contains(a, b),
}
if oper not in operators:
return [('id', 'in', [])]
return [("id", "in", [])]
servers = self.search([]).filtered(
lambda s: operators[oper](value, s.server_type)
)
return [('id', 'in', servers.ids)]
return [("id", "in", servers.ids)]

View File

@ -27,4 +27,4 @@ class IrMailServer(models.Model):
Can be customized in your model
"""
return 'outgoing_mail'
return "outgoing_mail"

View File

@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/server-env/tree/12.0/mail_environment"><img alt="OCA/server-env" src="https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-env-12-0/server-env-12-0-mail_environment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/254/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/server-env/tree/13.0/mail_environment"><img alt="OCA/server-env" src="https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-env-13-0/server-env-13-0-mail_environment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/254/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module allows to configure the incoming and outgoing mail servers
using the <cite>server_environment</cite> mechanism: you can then have different
mail servers for the production and the test environment.</p>
@ -450,7 +450,7 @@ runbot.</li>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-env/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/server-env/issues/new?body=module:%20mail_environment%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/server-env/issues/new?body=module:%20mail_environment%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@ -479,7 +479,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-env/tree/12.0/mail_environment">OCA/server-env</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-env/tree/13.0/mail_environment">OCA/server-env</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>