From d9a60f21253ab6e3dbb927f3cbf3b1340a1e7ecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Tue, 12 Jul 2016 20:03:33 +0200 Subject: [PATCH] base_optional_quick_create: fix bug detected by pylint --- base_optional_quick_create/i18n/en.po | 40 ------------------- base_optional_quick_create/i18n/fr.po | 22 ++++------ base_optional_quick_create/i18n/pt_BR.po | 22 ++++------ base_optional_quick_create/i18n/sl.po | 22 ++++------ base_optional_quick_create/i18n/zh_CN.po | 35 ++++++++++++++++ base_optional_quick_create/models/ir_model.py | 9 ++--- 6 files changed, 62 insertions(+), 88 deletions(-) delete mode 100644 base_optional_quick_create/i18n/en.po create mode 100644 base_optional_quick_create/i18n/zh_CN.po diff --git a/base_optional_quick_create/i18n/en.po b/base_optional_quick_create/i18n/en.po deleted file mode 100644 index f38fbec..0000000 --- a/base_optional_quick_create/i18n/en.po +++ /dev/null @@ -1,40 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * base_optional_quick_create -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: server-tools (8.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-29 11:14+0000\n" -"PO-Revision-Date: 2015-09-18 13:54+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: English (http://www.transifex.com/oca/OCA-server-tools-8-0/language/en/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: en\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: base_optional_quick_create -#: field:ir.model,avoid_quick_create:0 -msgid "Avoid quick create" -msgstr "Avoid quick create" - -#. module: base_optional_quick_create -#: code:addons/base_optional_quick_create/model.py:37 -#, python-format -msgid "Can't create quickly. Opening create form" -msgstr "Can't create quickly. Opening create form" - -#. module: base_optional_quick_create -#: code:addons/base_optional_quick_create/model.py:36 -#, python-format -msgid "Error" -msgstr "Error" - -#. module: base_optional_quick_create -#: model:ir.model,name:base_optional_quick_create.model_ir_model -msgid "Models" -msgstr "Models" diff --git a/base_optional_quick_create/i18n/fr.po b/base_optional_quick_create/i18n/fr.po index 94f8070..f2a6827 100644 --- a/base_optional_quick_create/i18n/fr.po +++ b/base_optional_quick_create/i18n/fr.po @@ -3,15 +3,15 @@ # * base_optional_quick_create # # Translators: -# FIRST AUTHOR , 2014 +# OCA Transbot , 2016 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: Odoo Server 9.0c\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-29 11:14+0000\n" -"PO-Revision-Date: 2015-09-18 13:54+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: French (http://www.transifex.com/oca/OCA-server-tools-8-0/language/fr/)\n" +"POT-Creation-Date: 2016-07-30 00:58+0000\n" +"PO-Revision-Date: 2016-07-30 00:58+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,22 +19,16 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: base_optional_quick_create -#: field:ir.model,avoid_quick_create:0 +#: model:ir.model.fields,field_description:base_optional_quick_create.field_ir_model_avoid_quick_create msgid "Avoid quick create" msgstr "" #. module: base_optional_quick_create -#: code:addons/base_optional_quick_create/model.py:37 +#: code:addons/base_optional_quick_create/models/ir_model.py:19 #, python-format msgid "Can't create quickly. Opening create form" msgstr "" -#. module: base_optional_quick_create -#: code:addons/base_optional_quick_create/model.py:36 -#, python-format -msgid "Error" -msgstr "Erreur" - #. module: base_optional_quick_create #: model:ir.model,name:base_optional_quick_create.model_ir_model msgid "Models" diff --git a/base_optional_quick_create/i18n/pt_BR.po b/base_optional_quick_create/i18n/pt_BR.po index 4746da6..a26f742 100644 --- a/base_optional_quick_create/i18n/pt_BR.po +++ b/base_optional_quick_create/i18n/pt_BR.po @@ -3,15 +3,15 @@ # * base_optional_quick_create # # Translators: -# Armando Vulcano Junior , 2015 +# OCA Transbot , 2016 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: Odoo Server 9.0c\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-29 11:14+0000\n" -"PO-Revision-Date: 2015-09-18 21:14+0000\n" -"Last-Translator: Armando Vulcano Junior \n" -"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-server-tools-8-0/language/pt_BR/)\n" +"POT-Creation-Date: 2016-07-30 00:58+0000\n" +"PO-Revision-Date: 2016-07-30 00:58+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,22 +19,16 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: base_optional_quick_create -#: field:ir.model,avoid_quick_create:0 +#: model:ir.model.fields,field_description:base_optional_quick_create.field_ir_model_avoid_quick_create msgid "Avoid quick create" msgstr "Evite criação rápida" #. module: base_optional_quick_create -#: code:addons/base_optional_quick_create/model.py:37 +#: code:addons/base_optional_quick_create/models/ir_model.py:19 #, python-format msgid "Can't create quickly. Opening create form" msgstr "Não pode criar rapidamente; Abrindo formulário de criação" -#. module: base_optional_quick_create -#: code:addons/base_optional_quick_create/model.py:36 -#, python-format -msgid "Error" -msgstr "Erro" - #. module: base_optional_quick_create #: model:ir.model,name:base_optional_quick_create.model_ir_model msgid "Models" diff --git a/base_optional_quick_create/i18n/sl.po b/base_optional_quick_create/i18n/sl.po index f7f462a..7897730 100644 --- a/base_optional_quick_create/i18n/sl.po +++ b/base_optional_quick_create/i18n/sl.po @@ -3,15 +3,15 @@ # * base_optional_quick_create # # Translators: -# Matjaž Mozetič , 2015 +# OCA Transbot , 2016 msgid "" msgstr "" -"Project-Id-Version: server-tools (8.0)\n" +"Project-Id-Version: Odoo Server 9.0c\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-29 11:14+0000\n" -"PO-Revision-Date: 2015-09-24 11:46+0000\n" -"Last-Translator: Matjaž Mozetič \n" -"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-server-tools-8-0/language/sl/)\n" +"POT-Creation-Date: 2016-07-30 00:58+0000\n" +"PO-Revision-Date: 2016-07-30 00:58+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,22 +19,16 @@ msgstr "" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" #. module: base_optional_quick_create -#: field:ir.model,avoid_quick_create:0 +#: model:ir.model.fields,field_description:base_optional_quick_create.field_ir_model_avoid_quick_create msgid "Avoid quick create" msgstr "Izogibanje hitremu ustvarjanju" #. module: base_optional_quick_create -#: code:addons/base_optional_quick_create/model.py:37 +#: code:addons/base_optional_quick_create/models/ir_model.py:19 #, python-format msgid "Can't create quickly. Opening create form" msgstr "Ne morete hitro ustvariti. Odpiram obrazec za ustvarjanje" -#. module: base_optional_quick_create -#: code:addons/base_optional_quick_create/model.py:36 -#, python-format -msgid "Error" -msgstr "Napaka" - #. module: base_optional_quick_create #: model:ir.model,name:base_optional_quick_create.model_ir_model msgid "Models" diff --git a/base_optional_quick_create/i18n/zh_CN.po b/base_optional_quick_create/i18n/zh_CN.po new file mode 100644 index 0000000..368e712 --- /dev/null +++ b/base_optional_quick_create/i18n/zh_CN.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * base_optional_quick_create +# +# Translators: +# Jeffery Chenn , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-31 11:58+0000\n" +"PO-Revision-Date: 2016-08-31 11:58+0000\n" +"Last-Translator: Jeffery Chenn , 2016\n" +"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/zh_CN/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: zh_CN\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: base_optional_quick_create +#: model:ir.model.fields,field_description:base_optional_quick_create.field_ir_model_avoid_quick_create +msgid "Avoid quick create" +msgstr "避免快速创建" + +#. module: base_optional_quick_create +#: code:addons/base_optional_quick_create/models/ir_model.py:19 +#, python-format +msgid "Can't create quickly. Opening create form" +msgstr "" + +#. module: base_optional_quick_create +#: model:ir.model,name:base_optional_quick_create.model_ir_model +msgid "Models" +msgstr "模型" diff --git a/base_optional_quick_create/models/ir_model.py b/base_optional_quick_create/models/ir_model.py index 229fc7c..e1b3787 100644 --- a/base_optional_quick_create/models/ir_model.py +++ b/base_optional_quick_create/models/ir_model.py @@ -2,10 +2,9 @@ # © 2013 Agile Business Group sagl () # © 2016 ACSONE SA/NA () -from openerp import api, fields, models -from openerp.exceptions import Warning +from openerp import api, fields, models, _ +from openerp.exceptions import UserError from openerp import SUPERUSER_ID -from openerp.tools.translate import _ class IrModel(models.Model): @@ -17,9 +16,7 @@ class IrModel(models.Model): def _wrap_name_create(): def wrapper(self, cr, uid, name, context=None): - raise orm.except_orm( - _('Error'), - _("Can't create quickly. Opening create form")) + raise UserError(_("Can't create quickly. Opening create form")) return wrapper for model in self.browse(cr, SUPERUSER_ID, ids):