Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[13.0][MIG] l10n_es_location_nuts #3895

Draft
wants to merge 20 commits into
base: 13.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.20
_commit: v1.28
_src_path: https://github.com/OCA/oca-addons-repo-template.git
ci: GitHub
convert_readme_fragments_to_markdown: false
enable_checklog_odoo: false
generate_requirements_txt: false
github_check_license: true
github_ci_extra_env: {}
Expand All @@ -11,7 +12,6 @@ github_enable_makepot: true
github_enable_stale_action: true
github_enforce_dev_status_compatibility: true
include_wkhtmltopdf: false
odoo_test_flavor: Both
odoo_version: 13.0
org_name: Odoo Community Association (OCA)
org_slug: OCA
Expand All @@ -23,4 +23,6 @@ repo_description: 'Repositorio de código del proyecto de la localización espa
repo_name: Localización española de Odoo
repo_slug: l10n-spain
repo_website: https://github.com/OCA/l10n-spain
travis_apt_packages: []
travis_apt_sources: []

13 changes: 2 additions & 11 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
pre-commit:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Get python version
Expand All @@ -27,15 +27,6 @@ jobs:
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure --color=always
env:
# Consider valid a PR that changes README fragments but doesn't
# change the README.rst file itself. It's not really a problem
# because the bot will update it anyway after merge. This way, we
# lower the barrier for functional contributors that want to fix the
# readme fragments, while still letting developers get README
# auto-generated (which also helps functionals when using runboat).
# DOCS https://pre-commit.com/#temporarily-disabling-hooks
SKIP: oca-gen-addon-readme
- name: Check that all files generated by pre-commit are in git
run: |
newfiles="$(git ls-files --others --exclude-from=.gitignore)"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Stale PRs and issues policy
uses: actions/stale@v4
uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# General settings.
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
# * Issues that are pending more information
# * Except Issues marked as "no stale"
- name: Needs more information stale issues policy
uses: actions/stale@v4
uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
ascending: true
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
name: Detect unreleased dependencies
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: |
for reqfile in requirements.txt test-requirements.txt ; do
if [ -f ${reqfile} ] ; then
Expand All @@ -36,10 +36,10 @@ jobs:
matrix:
include:
- container: ghcr.io/oca/oca-ci/py3.6-odoo13.0:latest
makepot: "true"
name: test with Odoo
- container: ghcr.io/oca/oca-ci/py3.6-ocb13.0:latest
name: test with OCB
makepot: "true"
services:
postgres:
image: postgres:9.6
Expand All @@ -50,7 +50,7 @@ jobs:
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install addons and dependencies
Expand All @@ -63,7 +63,9 @@ jobs:
run: oca_init_test_database
- name: Run tests
run: oca_run_tests
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Update .pot files
run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }}
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA' }}
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ var/
*.egg
*.eggs

# Windows installers
*.msi

# Debian packages
*.deb

# Redhat packages
*.rpm

# MacOS packages
*.dmg
*.pkg

# Installer logs
pip-log.txt
pip-delete-this-directory.txt
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ repos:
- id: oca-fix-manifest-website
args: ["https://github.com/OCA/l10n-spain"]
- repo: https://github.com/myint/autoflake
rev: v1.4
rev: v2.3.1
hooks:
- id: autoflake
args:
Expand Down Expand Up @@ -103,7 +103,7 @@ repos:
- id: pyupgrade
args: ["--keep-percent-format"]
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
rev: v5.10.1
hooks:
- id: isort
name: isort except __init__.py
Expand Down
105 changes: 105 additions & 0 deletions l10n_es_location_nuts/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
======================
NUTS Regions for Spain
======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f4df197593fcbc7f419296d7aefaae86b28c07b7e83f3fbbbd5673bc4a33f94f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-spain/tree/14.0/l10n_es_location_nuts
:alt: OCA/l10n-spain
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-spain-14-0/l10n-spain-14-0-l10n_es_location_nuts
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&target_branch=14.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Este módulo permite relacionar las regiones NUTS para España de nivel 4 con las
provincias españolas.

**Table of contents**

.. contents::
:local:

Configuration
=============

Después de instalar, debes clicar en el asistente de importación para añadir
las regiones NUTS en la base de datos de Odoo.

Ventas > Configuración > Libreta de direcciones > Importar NUTS 2013

Este asistente descargará del servicio europeo RAMON (Reference And Management
Of Nomenclatures) los metadatos para añadir las regiones NUTS en Odoo. Este
módulo específico de la localización española hereda este asistente genérico
para relacionar cada region NUTS española con las provincias españolas
definidas en Odoo.

Usage
=====

Sólo el administrador puede gestionar las regiones NUTS (realmente no es
necesario porque es una convención a nivel Europeo) pero cualquier usuario
puede leerlas, para que pueda asignarlas en el objeto Empresa (res.partner)

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-spain/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-spain/issues/new?body=module:%20l10n_es_location_nuts%0Aversion:%2014.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.

Credits
=======

Authors
~~~~~~~

* Tecnativa

Contributors
~~~~~~~~~~~~

* `Tecnativa <https://www.tecnativa.com>`_:

* Antonio Espinosa
* Rafael Blasco
* Jairo Llopis
* David Vidal
* Alexandre Díaz
* Ernesto Tejeda

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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/l10n-spain <https://github.com/OCA/l10n-spain/tree/14.0/l10n_es_location_nuts>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions l10n_es_location_nuts/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import wizard
from .hooks import post_init_hook
17 changes: 17 additions & 0 deletions l10n_es_location_nuts/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2015 Tecnativa - Antonio Espinosa
# Copyright 2015 Tecnativa - Jairo Llopis
# Copyright 2017 Tecnativa - David Vidal
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "NUTS Regions for Spain",
"summary": "NUTS specific options for Spain",
"version": "13.0.1.0.0",
"category": "Localisation/Europe",
"website": "https://github.com/OCA/l10n-spain",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["base_location_nuts"],
"post_init_hook": "post_init_hook",
}
20 changes: 20 additions & 0 deletions l10n_es_location_nuts/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# © 2015 Antiun Ingenieria S.L. - Antonio Espinosa
# © 2015 Antiun Ingenieria S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

import logging

from odoo import SUPERUSER_ID, api

_logger = logging.getLogger(__name__)


def post_init_hook(cr, registry):
"""Define Spanish specific configuration in res.country."""
with api.Environment.manage():
env = api.Environment(cr, SUPERUSER_ID, {})
spain = env.ref("base.es")
_logger.info("Setting Spain NUTS configuration")
spain.write(
{"state_level": 4,}
)
35 changes: 35 additions & 0 deletions l10n_es_location_nuts/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_es_location_nuts
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: ca\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"

#. module: l10n_es_location_nuts
#: model:ir.model.fields,field_description:l10n_es_location_nuts.field_nuts_import__display_name
msgid "Display Name"
msgstr ""

#. module: l10n_es_location_nuts
#: model:ir.model.fields,field_description:l10n_es_location_nuts.field_nuts_import__id
msgid "ID"
msgstr ""

#. module: l10n_es_location_nuts
#: model:ir.model,name:l10n_es_location_nuts.model_nuts_import
msgid "Import NUTS items from European ShowVoc service"
msgstr ""

#. module: l10n_es_location_nuts
#: model:ir.model.fields,field_description:l10n_es_location_nuts.field_nuts_import____last_update
msgid "Last Modified on"
msgstr ""
41 changes: 41 additions & 0 deletions l10n_es_location_nuts/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_es_location_nuts
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-12-30 17:05+0100\n"
"PO-Revision-Date: 2023-11-27 22:37+0000\n"
"Last-Translator: Ivorra78 <[email protected]>\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: l10n_es_location_nuts
#: model:ir.model.fields,field_description:l10n_es_location_nuts.field_nuts_import__display_name
msgid "Display Name"
msgstr "Mostrar Nombre"

#. module: l10n_es_location_nuts
#: model:ir.model.fields,field_description:l10n_es_location_nuts.field_nuts_import__id
msgid "ID"
msgstr "ID"

#. module: l10n_es_location_nuts
#: model:ir.model,name:l10n_es_location_nuts.model_nuts_import
msgid "Import NUTS items from European ShowVoc service"
msgstr ""

#. module: l10n_es_location_nuts
#: model:ir.model.fields,field_description:l10n_es_location_nuts.field_nuts_import____last_update
msgid "Last Modified on"
msgstr "Última Modificación el"

#~ msgid "Import NUTS items from European RAMON service"
#~ msgstr "Importar regiones NUTS desde el servicio europeo RAMON"
Loading
Loading