From 04f83bce85d14e5f74854ee7c94171b34bf996fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Gonz=C3=A1lez?= Date: Sun, 29 Mar 2020 02:23:35 +0000 Subject: [PATCH] [IMP] company_country: Fix and improve README and error messages Error messages and module description are improved to be more verbose, and some typos are fixed. --- company_country/README.rst | 23 ++++-- company_country/i18n/company_country.pot | 47 +----------- company_country/i18n/es.po | 32 ++++++++ company_country/i18n/es_MX.po | 74 ------------------- company_country/models/res_config.py | 10 ++- company_country/readme/CONFIGURE.rst | 2 +- company_country/readme/DESCRIPTION.rst | 10 ++- company_country/readme/INSTALL.rst | 2 +- company_country/readme/USAGE.rst | 2 +- company_country/static/description/index.html | 20 +++-- 10 files changed, 83 insertions(+), 139 deletions(-) create mode 100644 company_country/i18n/es.po delete mode 100644 company_country/i18n/es_MX.po diff --git a/company_country/README.rst b/company_country/README.rst index c7eb25ea3..5389cff24 100644 --- a/company_country/README.rst +++ b/company_country/README.rst @@ -25,8 +25,14 @@ Company Country |badge1| |badge2| |badge3| |badge4| |badge5| -This module allow set a country to main company in order to use the hook of -account that install l10n_** based on country of main company. +This module allows to set a country to the main company before the ``account`` +module is installed, so the hook of that module installs the correct +``l10n_***`` module. + +This is useful because, if the company isn't already set correctly when the +``account`` module is installed, the generic accounting chart will be installed +(``l10n_generic_coa``), which may be incorrect depending on your company's +country. **Table of contents** @@ -38,21 +44,21 @@ Installation To install this module, you need to: -#. Add as depends from your main module. +#. Add it as dependency from your main module. Configuration ============= To configure this module, you need to: -#. Set the environment variable COUNTRY using 2 letter of ISO 3166 codes. +#. Set the environment variable ``COUNTRY`` using a two-letter ISO 3166 code. Usage ===== To use this module, you need to: -#. Just start server installing your main module. +#. Just start the server installing your main module. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot @@ -103,10 +109,13 @@ promote its widespread use. .. |maintainer-moylop260| image:: https://github.com/moylop260.png?size=40px :target: https://github.com/moylop260 :alt: moylop260 +.. |maintainer-luisg123v| image:: https://github.com/luisg123v.png?size=40px + :target: https://github.com/luisg123v + :alt: luisg123v -Current `maintainer `__: +Current `maintainers `__: -|maintainer-moylop260| +|maintainer-moylop260| |maintainer-luisg123v| This module is part of the `OCA/server-tools `_ project on GitHub. diff --git a/company_country/i18n/company_country.pot b/company_country/i18n/company_country.pot index 3f85cb8eb..232628985 100644 --- a/company_country/i18n/company_country.pot +++ b/company_country/i18n/company_country.pot @@ -13,56 +13,17 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#. module: company_country -#: model:ir.model,name:company_country.model_company_country_config_settings -msgid "Company Country Configuration Settings" -msgstr "" - #. module: company_country #: code:addons/company_country/models/res_config.py:0 #, python-format -msgid "Country code %s not found. Use ISO 3166 codes 2 letters" -msgstr "" - -#. module: company_country -#: model:ir.model.fields,field_description:company_country.field_company_country_config_settings__create_uid -msgid "Created by" -msgstr "" - -#. module: company_country -#: model:ir.model.fields,field_description:company_country.field_company_country_config_settings__create_date -msgid "Created on" -msgstr "" - -#. module: company_country -#: model:ir.model.fields,field_description:company_country.field_company_country_config_settings__display_name -msgid "Display Name" +msgid "" +"COUNTRY environment variable with country code is not set and no " +"localization module is marked to be installed." msgstr "" #. module: company_country #: code:addons/company_country/models/res_config.py:0 #, python-format msgid "" -"Error COUNTRY environment variable with country code not defined and no " -"localization found in pool." -msgstr "" - -#. module: company_country -#: model:ir.model.fields,field_description:company_country.field_company_country_config_settings__id -msgid "ID" -msgstr "" - -#. module: company_country -#: model:ir.model.fields,field_description:company_country.field_company_country_config_settings____last_update -msgid "Last Modified on" -msgstr "" - -#. module: company_country -#: model:ir.model.fields,field_description:company_country.field_company_country_config_settings__write_uid -msgid "Last Updated by" -msgstr "" - -#. module: company_country -#: model:ir.model.fields,field_description:company_country.field_company_country_config_settings__write_date -msgid "Last Updated on" +"Country code %s was not found. Please use a valid two-letter ISO 3166 code." msgstr "" diff --git a/company_country/i18n/es.po b/company_country/i18n/es.po new file mode 100644 index 000000000..6ed83bc4a --- /dev/null +++ b/company_country/i18n/es.po @@ -0,0 +1,32 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * company_country +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-02-15 15:13+0000\n" +"Last-Translator: Jesús Alan Ramos Rodríguez \n" +"Language-Team: none\n" +"Language: es_MX\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.10\n" + +#. module: company_country +#: code:addons/company_country/models/res_config.py:0 +#, python-format +msgid "" +"COUNTRY environment variable with country code is not set and no " +"localization module is marked to be installed." +msgstr "" + +#. module: company_country +#: code:addons/company_country/models/res_config.py:0 +#, python-format +msgid "" +"Country code %s was not found. Please use a valid two-letter ISO 3166 code." +msgstr "" diff --git a/company_country/i18n/es_MX.po b/company_country/i18n/es_MX.po deleted file mode 100644 index f2c54da1f..000000000 --- a/company_country/i18n/es_MX.po +++ /dev/null @@ -1,74 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * company_country -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 13.0\n" -"Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2020-02-15 15:13+0000\n" -"Last-Translator: Jesús Alan Ramos Rodríguez \n" -"Language-Team: none\n" -"Language: es_MX\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.10\n" - -#. module: company_country -#: model:ir.model,name:company_country.model_company_country_config_settings -msgid "Company Country Configuration Settings" -msgstr "Ajustes de configuración del país de la empresa" - -#. module: company_country -#: code:addons/company_country/models/res_config.py:0 -#, python-format -msgid "Country code %s not found. Use ISO 3166 codes 2 letters" -msgstr "" -"Código de país %s no encontrado. Utilice los códigos ISO 3166 de 2 letras" - -#. module: company_country -#: model:ir.model.fields,field_description:company_country.field_company_country_config_settings__create_uid -msgid "Created by" -msgstr "Creado por" - -#. module: company_country -#: model:ir.model.fields,field_description:company_country.field_company_country_config_settings__create_date -msgid "Created on" -msgstr "Creado en" - -#. module: company_country -#: model:ir.model.fields,field_description:company_country.field_company_country_config_settings__display_name -msgid "Display Name" -msgstr "Nombre para Mostrar" - -#. module: company_country -#: code:addons/company_country/models/res_config.py:0 -#, python-format -msgid "" -"Error COUNTRY environment variable with country code not defined and no " -"localization found in pool." -msgstr "" -"Error la variable de entorno COUNTRY con código de país no definida y no se " -"encontró localización en el grupo." - -#. module: company_country -#: model:ir.model.fields,field_description:company_country.field_company_country_config_settings__id -msgid "ID" -msgstr "ID" - -#. module: company_country -#: model:ir.model.fields,field_description:company_country.field_company_country_config_settings____last_update -msgid "Last Modified on" -msgstr "Última Modificación el" - -#. module: company_country -#: model:ir.model.fields,field_description:company_country.field_company_country_config_settings__write_uid -msgid "Last Updated by" -msgstr "Última Modificación por" - -#. module: company_country -#: model:ir.model.fields,field_description:company_country.field_company_country_config_settings__write_date -msgid "Last Updated on" -msgstr "Última Modificación en" diff --git a/company_country/models/res_config.py b/company_country/models/res_config.py index 044c85f8c..14fd2da09 100644 --- a/company_country/models/res_config.py +++ b/company_country/models/res_config.py @@ -36,8 +36,9 @@ class CompanyCountryConfigSettings(models.AbstractModel): if not l10n_to_install: raise ValidationError( _( - "Error COUNTRY environment variable with country code " - "not defined and no localization found in pool." + "COUNTRY environment variable with country code is not " + "set and no localization module is marked to be " + "installed." ) ) country_code = l10n_to_install.name.split("l10n_")[1][:2].upper() @@ -47,6 +48,9 @@ class CompanyCountryConfigSettings(models.AbstractModel): ) if not country: raise ValidationError( - _("Country code %s not found. Use ISO 3166 codes 2 letters") + _( + "Country code %s was not found. Please use a valid two-letter " + "ISO 3166 code." + ) ) self.env.ref("base.main_company").write({"country_id": country.id}) diff --git a/company_country/readme/CONFIGURE.rst b/company_country/readme/CONFIGURE.rst index 47a61effd..c26939969 100644 --- a/company_country/readme/CONFIGURE.rst +++ b/company_country/readme/CONFIGURE.rst @@ -1,3 +1,3 @@ To configure this module, you need to: -#. Set the environment variable COUNTRY using 2 letter of ISO 3166 codes. +#. Set the environment variable ``COUNTRY`` using a two-letter ISO 3166 code. diff --git a/company_country/readme/DESCRIPTION.rst b/company_country/readme/DESCRIPTION.rst index 09aa697f9..2f689b9a5 100644 --- a/company_country/readme/DESCRIPTION.rst +++ b/company_country/readme/DESCRIPTION.rst @@ -1,2 +1,8 @@ -This module allow set a country to main company in order to use the hook of -account that install l10n_** based on country of main company. +This module allows to set a country to the main company before the ``account`` +module is installed, so the hook of that module installs the correct +``l10n_***`` module. + +This is useful because, if the company isn't already set correctly when the +``account`` module is installed, the generic accounting chart will be installed +(``l10n_generic_coa``), which may be incorrect depending on your company's +country. diff --git a/company_country/readme/INSTALL.rst b/company_country/readme/INSTALL.rst index 8940b3f29..735089d79 100644 --- a/company_country/readme/INSTALL.rst +++ b/company_country/readme/INSTALL.rst @@ -1,3 +1,3 @@ To install this module, you need to: -#. Add as depends from your main module. +#. Add it as dependency from your main module. diff --git a/company_country/readme/USAGE.rst b/company_country/readme/USAGE.rst index cb3673b3c..602747a88 100644 --- a/company_country/readme/USAGE.rst +++ b/company_country/readme/USAGE.rst @@ -1,6 +1,6 @@ To use this module, you need to: -#. Just start server installing your main module. +#. Just start the server installing your main module. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot diff --git a/company_country/static/description/index.html b/company_country/static/description/index.html index 21a70a48a..4c6a7504e 100644 --- a/company_country/static/description/index.html +++ b/company_country/static/description/index.html @@ -368,8 +368,13 @@ ul.auto-toc { !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runbot

-

This module allow set a country to main company in order to use the hook of -account that install l10n_** based on country of main company.

+

This module allows to set a country to the main company before the account +module is installed, so the hook of that module installs the correct +l10n_*** module.

+

This is useful because, if the company isn’t already set correctly when the +account module is installed, the generic accounting chart will be installed +(l10n_generic_coa), which may be incorrect depending on your company’s +country.

Table of contents

    @@ -390,21 +395,21 @@ account that install l10n_** based on country of main company.

    Installation

    To install this module, you need to:

      -
    1. Add as depends from your main module.
    2. +
    3. Add it as dependency from your main module.

Configuration

To configure this module, you need to:

    -
  1. Set the environment variable COUNTRY using 2 letter of ISO 3166 codes.
  2. +
  3. Set the environment variable COUNTRY using a two-letter ISO 3166 code.

Usage

To use this module, you need to:

    -
  1. Just start server installing your main module.
  2. +
  3. Just start the server installing your main module.
Try me on Runbot
@@ -428,6 +433,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

Contributors

@@ -441,8 +447,8 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

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.

-

Current maintainer:

-

moylop260

+

Current maintainers:

+

moylop260 luisg123v

This module is part of the OCA/server-tools project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.