diff --git a/base_optional_quick_create/__manifest__.py b/base_optional_quick_create/__manifest__.py index 0ba25d2..6f0f78d 100644 --- a/base_optional_quick_create/__manifest__.py +++ b/base_optional_quick_create/__manifest__.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- -# © 2013 Agile Business Group sagl () -# © 2016 ACSONE SA/NA () +# Copyright 2013 Agile Business Group sagl () +# Copyright 2016 ACSONE SA/NA () { 'name': "Optional quick create", - 'version': '10.0.1.0.0', + 'version': '10.0.1.0.1', 'category': 'Tools', 'summary': "Avoid 'quick create' on m2o fields, on a 'by model' basis", 'author': "Agile Business Group,Odoo Community Association (OCA)", diff --git a/base_optional_quick_create/i18n/base_optional_quick_create.pot b/base_optional_quick_create/i18n/base_optional_quick_create.pot index 222dc31..e5fff97 100644 --- a/base_optional_quick_create/i18n/base_optional_quick_create.pot +++ b/base_optional_quick_create/i18n/base_optional_quick_create.pot @@ -1,13 +1,11 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: # * base_optional_quick_create # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-14 17:41+0000\n" -"PO-Revision-Date: 2014-03-14 17:41+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -16,25 +14,19 @@ msgstr "" "Plural-Forms: \n" #. module: base_optional_quick_create -#: model:_description:0 -#: model:ir.model,name:base_optional_quick_create.model_ir_model -msgid "Models" +#: 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:35 +#: code:addons/base_optional_quick_create/models/ir_model.py:21 #, python-format -msgid "Can't create quickly. Opening create form" -msgstr "" - -#. module: base_optional_quick_create -#: field:ir.model,avoid_quick_create:0 -msgid "Avoid quick create" +msgid "Can't create %s with name %s quickly.\n" +"Please contact your system administrator to disable this behaviour." msgstr "" #. module: base_optional_quick_create -#: code:addons/base_optional_quick_create/model.py:35 -#, python-format -msgid "Error" +#: model:ir.model,name:base_optional_quick_create.model_ir_model +msgid "Models" msgstr "" diff --git a/base_optional_quick_create/i18n/de.po b/base_optional_quick_create/i18n/de.po index f70b3d3..54eff83 100644 --- a/base_optional_quick_create/i18n/de.po +++ b/base_optional_quick_create/i18n/de.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * base_optional_quick_create -# +# # Translators: # OCA Transbot , 2017 # Rudolf Schnapka , 2017 @@ -10,14 +10,15 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-05-10 00:47+0000\n" -"PO-Revision-Date: 2017-05-10 00:47+0000\n" -"Last-Translator: Rudolf Schnapka , 2017\n" +"PO-Revision-Date: 2018-09-06 13:26+0000\n" +"Last-Translator: Rudolf Schnapka \n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: de\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.1.1\n" #. module: base_optional_quick_create #: model:ir.model.fields,field_description:base_optional_quick_create.field_ir_model_avoid_quick_create @@ -27,10 +28,17 @@ msgstr "Unterbinde Schnellanlage" #. module: base_optional_quick_create #: code:addons/base_optional_quick_create/models/ir_model.py:21 #, python-format -msgid "Can't create quickly. Opening create form" -msgstr "Kann Schnellanlage nicht ausführen. Verwenden Sie Formularanlage" +msgid "" +"Can't create %s with name %s quickly.\n" +"Please contact your system administrator to disable this behaviour." +msgstr "" +"Kann %s mit Name %s nicht schnell anlegen.\n" +"Sprechen Sie mit dem Administrator, um dieses Verhalten abzustellen." #. module: base_optional_quick_create #: model:ir.model,name:base_optional_quick_create.model_ir_model msgid "Models" msgstr "Datenmodelle" + +#~ msgid "Can't create quickly. Opening create form" +#~ msgstr "Kann Schnellanlage nicht ausführen. Verwenden Sie Formularanlage" diff --git a/base_optional_quick_create/i18n/es.po b/base_optional_quick_create/i18n/es.po index 19294f1..6a3d28a 100644 --- a/base_optional_quick_create/i18n/es.po +++ b/base_optional_quick_create/i18n/es.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * base_optional_quick_create -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-05-01 10:38+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: base_optional_quick_create @@ -26,7 +26,9 @@ msgstr "" #. module: base_optional_quick_create #: code:addons/base_optional_quick_create/models/ir_model.py:21 #, python-format -msgid "Can't create quickly. Opening create form" +msgid "" +"Can't create %s with name %s quickly.\n" +"Please contact your system administrator to disable this behaviour." msgstr "" #. module: base_optional_quick_create diff --git a/base_optional_quick_create/i18n/fi.po b/base_optional_quick_create/i18n/fi.po index 119feb5..d9c4e77 100644 --- a/base_optional_quick_create/i18n/fi.po +++ b/base_optional_quick_create/i18n/fi.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * base_optional_quick_create -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-05-01 10:38+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" +"Language: fi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: base_optional_quick_create @@ -26,7 +26,9 @@ msgstr "" #. module: base_optional_quick_create #: code:addons/base_optional_quick_create/models/ir_model.py:21 #, python-format -msgid "Can't create quickly. Opening create form" +msgid "" +"Can't create %s with name %s quickly.\n" +"Please contact your system administrator to disable this behaviour." msgstr "" #. module: base_optional_quick_create diff --git a/base_optional_quick_create/i18n/fr.po b/base_optional_quick_create/i18n/fr.po index f2a6827..137bbde 100644 --- a/base_optional_quick_create/i18n/fr.po +++ b/base_optional_quick_create/i18n/fr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * base_optional_quick_create -# +# # Translators: # OCA Transbot , 2016 msgid "" @@ -12,10 +12,10 @@ msgstr "" "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" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: base_optional_quick_create @@ -24,9 +24,11 @@ msgid "Avoid quick create" msgstr "" #. module: base_optional_quick_create -#: code:addons/base_optional_quick_create/models/ir_model.py:19 +#: code:addons/base_optional_quick_create/models/ir_model.py:21 #, python-format -msgid "Can't create quickly. Opening create form" +msgid "" +"Can't create %s with name %s quickly.\n" +"Please contact your system administrator to disable this behaviour." msgstr "" #. module: base_optional_quick_create diff --git a/base_optional_quick_create/i18n/hr.po b/base_optional_quick_create/i18n/hr.po index 2bf005d..7bee283 100644 --- a/base_optional_quick_create/i18n/hr.po +++ b/base_optional_quick_create/i18n/hr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * base_optional_quick_create -# +# # Translators: # OCA Transbot , 2017 # Bole , 2017 @@ -13,11 +13,12 @@ msgstr "" "PO-Revision-Date: 2017-07-13 01:00+0000\n" "Last-Translator: Bole , 2017\n" "Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: hr\n" -"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" +"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: base_optional_quick_create #: model:ir.model.fields,field_description:base_optional_quick_create.field_ir_model_avoid_quick_create @@ -27,10 +28,15 @@ msgstr "Izbjegni brzo kreiranje" #. module: base_optional_quick_create #: code:addons/base_optional_quick_create/models/ir_model.py:21 #, python-format -msgid "Can't create quickly. Opening create form" -msgstr "Nije moguće brzo kreiranje, otvaram formu za kreiranje" +msgid "" +"Can't create %s with name %s quickly.\n" +"Please contact your system administrator to disable this behaviour." +msgstr "" #. module: base_optional_quick_create #: model:ir.model,name:base_optional_quick_create.model_ir_model msgid "Models" msgstr "Modeli" + +#~ msgid "Can't create quickly. Opening create form" +#~ msgstr "Nije moguće brzo kreiranje, otvaram formu za kreiranje" diff --git a/base_optional_quick_create/i18n/hr_HR.po b/base_optional_quick_create/i18n/hr_HR.po index 1504035..ae2e1e5 100644 --- a/base_optional_quick_create/i18n/hr_HR.po +++ b/base_optional_quick_create/i18n/hr_HR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * base_optional_quick_create -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,12 +11,14 @@ msgstr "" "POT-Creation-Date: 2017-05-01 10:38+0000\n" "PO-Revision-Date: 2017-05-01 10:38+0000\n" "Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/hr_HR/)\n" +"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/" +"hr_HR/)\n" +"Language: hr_HR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: hr_HR\n" -"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" +"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: base_optional_quick_create #: model:ir.model.fields,field_description:base_optional_quick_create.field_ir_model_avoid_quick_create @@ -26,7 +28,9 @@ msgstr "" #. module: base_optional_quick_create #: code:addons/base_optional_quick_create/models/ir_model.py:21 #, python-format -msgid "Can't create quickly. Opening create form" +msgid "" +"Can't create %s with name %s quickly.\n" +"Please contact your system administrator to disable this behaviour." msgstr "" #. module: base_optional_quick_create diff --git a/base_optional_quick_create/i18n/it.po b/base_optional_quick_create/i18n/it.po index c9b6712..b2d33bc 100644 --- a/base_optional_quick_create/i18n/it.po +++ b/base_optional_quick_create/i18n/it.po @@ -1,33 +1,36 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * base_optional_quick_create -# -# Translators: -# OCA Transbot , 2017 +# * base_optional_quick_create +# msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 10.0+e\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-05-01 10:38+0000\n" -"PO-Revision-Date: 2017-05-01 10:38+0000\n" -"Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"POT-Creation-Date: 2018-03-19 17:10+0000\n" +"PO-Revision-Date: 2018-03-19 17:10+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: it\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: \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 "" +msgstr "Evita creazione veloce" #. module: base_optional_quick_create #: code:addons/base_optional_quick_create/models/ir_model.py:21 #, python-format -msgid "Can't create quickly. Opening create form" +msgid "" +"Can't create %s with name %s quickly.\n" +"Please contact your system administrator to disable this behaviour." msgstr "" +"Non è possibile creare velocemente un %s con nome %s.\n" +"Si prega di contattare l'amministratore di sistema per disabilitare questo " +"comportamento." #. module: base_optional_quick_create #: model:ir.model,name:base_optional_quick_create.model_ir_model diff --git a/base_optional_quick_create/i18n/nb_NO.po b/base_optional_quick_create/i18n/nb_NO.po index 53a65d6..b5bdeba 100644 --- a/base_optional_quick_create/i18n/nb_NO.po +++ b/base_optional_quick_create/i18n/nb_NO.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * base_optional_quick_create -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-05-01 10:38+0000\n" "PO-Revision-Date: 2017-05-01 10:38+0000\n" "Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Norwegian Bokmål (Norway) (https://www.transifex.com/oca/teams/23907/nb_NO/)\n" +"Language-Team: Norwegian Bokmål (Norway) (https://www.transifex.com/oca/" +"teams/23907/nb_NO/)\n" +"Language: nb_NO\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: nb_NO\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: base_optional_quick_create @@ -26,7 +27,9 @@ msgstr "" #. module: base_optional_quick_create #: code:addons/base_optional_quick_create/models/ir_model.py:21 #, python-format -msgid "Can't create quickly. Opening create form" +msgid "" +"Can't create %s with name %s quickly.\n" +"Please contact your system administrator to disable this behaviour." msgstr "" #. module: base_optional_quick_create diff --git a/base_optional_quick_create/i18n/pt_BR.po b/base_optional_quick_create/i18n/pt_BR.po index eebc65d..67c48da 100644 --- a/base_optional_quick_create/i18n/pt_BR.po +++ b/base_optional_quick_create/i18n/pt_BR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * base_optional_quick_create -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-05-01 10:38+0000\n" "PO-Revision-Date: 2017-05-01 10:38+0000\n" "Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: base_optional_quick_create @@ -26,10 +27,15 @@ msgstr "Evite criação rápida" #. module: base_optional_quick_create #: code:addons/base_optional_quick_create/models/ir_model.py:21 #, python-format -msgid "Can't create quickly. Opening create form" -msgstr "Não pode criar rapidamente; Abrindo formulário de criação" +msgid "" +"Can't create %s with name %s quickly.\n" +"Please contact your system administrator to disable this behaviour." +msgstr "" #. module: base_optional_quick_create #: model:ir.model,name:base_optional_quick_create.model_ir_model msgid "Models" msgstr "Modelos" + +#~ msgid "Can't create quickly. Opening create form" +#~ msgstr "Não pode criar rapidamente; Abrindo formulário de criação" diff --git a/base_optional_quick_create/i18n/sl.po b/base_optional_quick_create/i18n/sl.po index cd4fc77..b185476 100644 --- a/base_optional_quick_create/i18n/sl.po +++ b/base_optional_quick_create/i18n/sl.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * base_optional_quick_create -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,11 +12,12 @@ msgstr "" "PO-Revision-Date: 2017-05-01 10:38+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: sl\n" -"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" +"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 #: model:ir.model.fields,field_description:base_optional_quick_create.field_ir_model_avoid_quick_create @@ -26,10 +27,15 @@ msgstr "Izogibanje hitremu ustvarjanju" #. module: base_optional_quick_create #: code:addons/base_optional_quick_create/models/ir_model.py:21 #, python-format -msgid "Can't create quickly. Opening create form" -msgstr "Ne morete hitro ustvariti. Odpiram obrazec za ustvarjanje" +msgid "" +"Can't create %s with name %s quickly.\n" +"Please contact your system administrator to disable this behaviour." +msgstr "" #. module: base_optional_quick_create #: model:ir.model,name:base_optional_quick_create.model_ir_model msgid "Models" msgstr "Modeli" + +#~ msgid "Can't create quickly. Opening create form" +#~ msgstr "Ne morete hitro ustvariti. Odpiram obrazec za ustvarjanje" diff --git a/base_optional_quick_create/i18n/tr.po b/base_optional_quick_create/i18n/tr.po index 36836df..fa60754 100644 --- a/base_optional_quick_create/i18n/tr.po +++ b/base_optional_quick_create/i18n/tr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * base_optional_quick_create -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-05-01 10:38+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"Language: tr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: tr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: base_optional_quick_create @@ -26,7 +26,9 @@ msgstr "" #. module: base_optional_quick_create #: code:addons/base_optional_quick_create/models/ir_model.py:21 #, python-format -msgid "Can't create quickly. Opening create form" +msgid "" +"Can't create %s with name %s quickly.\n" +"Please contact your system administrator to disable this behaviour." msgstr "" #. module: base_optional_quick_create diff --git a/base_optional_quick_create/i18n/tr_TR.po b/base_optional_quick_create/i18n/tr_TR.po index 2225711..8357c45 100644 --- a/base_optional_quick_create/i18n/tr_TR.po +++ b/base_optional_quick_create/i18n/tr_TR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * base_optional_quick_create -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-05-01 10:38+0000\n" "PO-Revision-Date: 2017-05-01 10:38+0000\n" "Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Turkish (Turkey) (https://www.transifex.com/oca/teams/23907/tr_TR/)\n" +"Language-Team: Turkish (Turkey) (https://www.transifex.com/oca/teams/23907/" +"tr_TR/)\n" +"Language: tr_TR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: tr_TR\n" "Plural-Forms: nplurals=1; plural=0;\n" #. module: base_optional_quick_create @@ -26,7 +27,9 @@ msgstr "" #. module: base_optional_quick_create #: code:addons/base_optional_quick_create/models/ir_model.py:21 #, python-format -msgid "Can't create quickly. Opening create form" +msgid "" +"Can't create %s with name %s quickly.\n" +"Please contact your system administrator to disable this behaviour." msgstr "" #. module: base_optional_quick_create diff --git a/base_optional_quick_create/i18n/zh_CN.po b/base_optional_quick_create/i18n/zh_CN.po index 368e712..4d54fa2 100644 --- a/base_optional_quick_create/i18n/zh_CN.po +++ b/base_optional_quick_create/i18n/zh_CN.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * base_optional_quick_create -# +# # Translators: # Jeffery Chenn , 2016 msgid "" @@ -11,11 +11,12 @@ msgstr "" "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" +"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/" +"zh_CN/)\n" +"Language: 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 @@ -24,9 +25,11 @@ msgid "Avoid quick create" msgstr "避免快速创建" #. module: base_optional_quick_create -#: code:addons/base_optional_quick_create/models/ir_model.py:19 +#: code:addons/base_optional_quick_create/models/ir_model.py:21 #, python-format -msgid "Can't create quickly. Opening create form" +msgid "" +"Can't create %s with name %s quickly.\n" +"Please contact your system administrator to disable this behaviour." msgstr "" #. module: base_optional_quick_create diff --git a/base_optional_quick_create/models/ir_model.py b/base_optional_quick_create/models/ir_model.py index 8bbd3e5..014e272 100644 --- a/base_optional_quick_create/models/ir_model.py +++ b/base_optional_quick_create/models/ir_model.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# © 2013 Agile Business Group sagl () -# © 2016 ACSONE SA/NA () -# © 2016 Akretion (Alexis de Lattre ) +# Copyright 2016 ACSONE SA/NA () +# Copyright 2016 Akretion (Alexis de Lattre ) +# Copyright 2018 Simone Rubino - Agile Business Group from odoo import api, fields, models, _ from odoo.exceptions import UserError @@ -15,21 +15,24 @@ class IrModel(models.Model): @api.multi def _patch_quick_create(self): - @api.multi def _wrap_name_create(): - def wrapper(self): - raise UserError(_("Can't create quickly. Opening create form")) + @api.model + def wrapper(self, name): + raise UserError(_( + "Can't create %s with name %s quickly.\n" + "Please contact your system administrator to disable " + "this behaviour.") % (self._name, name)) return wrapper + method_name = 'name_create' for model in self: + model_obj = self.env.get(model.model) if model.avoid_quick_create: - model_name = model.model - model_obj = self.env.get(model_name) - if ( - not isinstance(model_obj, type(None)) and - not hasattr(model_obj, 'check_quick_create')): - model_obj._patch_method('name_create', _wrap_name_create()) - model_obj.check_quick_create = True + model_obj._patch_method(method_name, _wrap_name_create()) + else: + method = getattr(model_obj, method_name, None) + if method and hasattr(method, 'origin'): + model_obj._revert_method(method_name) return True def _register_hook(self): diff --git a/base_optional_quick_create/tests/__init__.py b/base_optional_quick_create/tests/__init__.py new file mode 100644 index 0000000..3af4c0e --- /dev/null +++ b/base_optional_quick_create/tests/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import test_quick_create diff --git a/base_optional_quick_create/tests/test_quick_create.py b/base_optional_quick_create/tests/test_quick_create.py new file mode 100644 index 0000000..c468874 --- /dev/null +++ b/base_optional_quick_create/tests/test_quick_create.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 Simone Rubino - Agile Business Group +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.exceptions import UserError +from odoo.tests.common import TransactionCase + + +class TestQuickCreate(TransactionCase): + + def setUp(self, *args, **kwargs): + super(TestQuickCreate, self).setUp() + model_model = self.env['ir.model'] + self.partner_model = model_model.search([ + ('model', '=', 'res.partner')]) + + def test_quick_create(self): + partner_id = self.env['res.partner'].name_create('TEST partner') + self.assertEqual(bool(partner_id), True) + + # Setting the flag, patches the method + self.partner_model.avoid_quick_create = True + with self.assertRaises(UserError): + self.env['res.partner'].name_create('TEST partner') + + # Unsetting the flag, unpatches the method + self.partner_model.avoid_quick_create = False + partner_id = self.env['res.partner'].name_create('TEST partner') + self.assertEqual(bool(partner_id), True)