diff --git a/company_country/README.rst b/company_country/README.rst index 6984b8846..a74a973c6 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 @@ -88,7 +94,6 @@ Other credits Vauxoo - Maintainers ~~~~~~~~~~~ diff --git a/company_country/i18n/company_country.pot b/company_country/i18n/company_country.pot index 2eeef001d..6e02f05f2 100644 --- a/company_country/i18n/company_country.pot +++ b/company_country/i18n/company_country.pot @@ -14,34 +14,14 @@ msgstr "" "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:47 +#: code:addons/company_country/models/res_config.py:38 #, 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__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:39 +#: code:addons/company_country/models/res_config.py:47 #, 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" +msgid "Country code %s was not found. Please use a valid two-letter ISO 3166 code." msgstr "" diff --git a/company_country/models/res_config.py b/company_country/models/res_config.py index 235ee26d5..9e410f026 100644 --- a/company_country/models/res_config.py +++ b/company_country/models/res_config.py @@ -35,14 +35,16 @@ class CompanyCountryConfigSettings(models.AbstractModel): ('state', '=', 'to install'), ('name', '=like', 'l10n_%')], limit=1) if not l10n_to_install: - raise ValidationError( - _('Error COUNTRY environment variable with country code ' - 'not defined and no localization found in pool.')) + raise ValidationError(_( + '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() country = self.env['res.country'].search([ ('code', 'ilike', country_code)], limit=1) if not country: - raise ValidationError( - _('Country code %s not found. Use ISO 3166 codes 2 letters')) + raise ValidationError(_( + '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/CREDITS.rst b/company_country/readme/CREDITS.rst index 2f99b446d..d0ec12698 100644 --- a/company_country/readme/CREDITS.rst +++ b/company_country/readme/CREDITS.rst @@ -1,2 +1 @@ Vauxoo - diff --git a/company_country/readme/DESCRIPTION.rst b/company_country/readme/DESCRIPTION.rst index 3b4985157..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 6f0149c3f..5ef4d443c 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 2b284c3f2..bf1bf8260 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

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