Skip to content

Commit

Permalink
[MIG] l10n_es_partner: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mpascuall committed Feb 18, 2025
1 parent 0e921fa commit 0f17c60
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 97 deletions.
58 changes: 31 additions & 27 deletions l10n_es_partner/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@ Adaptación de los clientes, proveedores y bancos para España
: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/17.0/l10n_es_partner
:target: https://github.com/OCA/l10n-spain/tree/18.0/l10n_es_partner
: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-17-0/l10n-spain-17-0-l10n_es_partner
:target: https://translation.odoo-community.org/projects/l10n-spain-18-0/l10n-spain-18-0-l10n_es_partner
: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=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&target_branch=18.0
:alt: Try me on Runboat

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

Incluye la siguiente funcionalidad:

- Añade el campo *Nombre comercial* a las empresas y permite buscar por
él.
- Permite definir un patrón del nombre a mostrar a partir del nombre y
el nombre comercial de la empresa.
- Añade los campos nombre largo, NIF y web a los bancos.
- Añade los datos de los bancos españoles extraídos del registro oficial
del Banco de España (http://goo.gl/mtx6ic). El asistente realiza la
descarga automática de Internet, pero si por cualquier razón hay algún
problema, existe una copia local cuya última actualización fue el
26/10/2017.
- Añade el campo *Nombre comercial* a las empresas y permite buscar por
él.
- Permite definir un patrón del nombre a mostrar a partir del nombre y
el nombre comercial de la empresa.
- Añade los campos nombre largo, NIF y web a los bancos.
- Añade los datos de los bancos españoles extraídos del registro
oficial del Banco de España (http://goo.gl/mtx6ic). El asistente
realiza la descarga automática de Internet, pero si por cualquier
razón hay algún problema, existe una copia local cuya última
actualización fue el 26/10/2017.

**Table of contents**

Expand Down Expand Up @@ -69,18 +69,21 @@ Seleccionar la clave l10n_es_partner.name_pattern Definir el patron
utilizando las etiquetas *%(name)s* para nombre y *%(comercial_name)s*
para nombre comercial.

Para importar los datos de los bancos españoles hay que ir a Facturación
> Configuración > Import spanish bank data

Known issues / Roadmap
======================

- Take BICs from https://github.com/PeterNotenboom/SwiftCodes.
- Take BICs from https://github.com/PeterNotenboom/SwiftCodes.

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_partner%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/l10n-spain/issues/new?body=module:%20l10n_es_partner%0Aversion:%2018.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.

Expand All @@ -97,20 +100,21 @@ Authors
Contributors
------------

- Jordi Esteve <[email protected]>
- Ignacio Ibeas <[email protected]>
- Pedro M. Baeza <[email protected]>
- Sergio Teruel <[email protected]>
- Ismael Calvo <[email protected]>
- Carlos Dauden <[email protected]>
- Manuel Regidor <[email protected]>
- `APSL <https://apsl.tech>`__:
- Jordi Esteve <[email protected]>
- Ignacio Ibeas <[email protected]>
- Pedro M. Baeza <[email protected]>
- Sergio Teruel <[email protected]>
- Ismael Calvo <[email protected]>
- Carlos Dauden <[email protected]>
- Manuel Regidor <[email protected]>
- `APSL - Nagarro <https://apsl.tech>`__:

- Javier Antó <[email protected]>
- Javier Antó <[email protected]>
- Miquel Pascual <[email protected]>

- `Dixmit <https://www.dixmit.com>`__:
- `Dixmit <https://www.dixmit.com>`__:

- Enric Tobella
- Enric Tobella

Maintainers
-----------
Expand All @@ -133,6 +137,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-pedrobaeza|

This module is part of the `OCA/l10n-spain <https://github.com/OCA/l10n-spain/tree/17.0/l10n_es_partner>`_ project on GitHub.
This module is part of the `OCA/l10n-spain <https://github.com/OCA/l10n-spain/tree/18.0/l10n_es_partner>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion l10n_es_partner/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{
"name": "Adaptación de los clientes, proveedores y bancos para España",
"version": "17.0.1.0.1",
"version": "18.0.1.0.0",
"author": "ZikZak," "Acysos," "Tecnativa," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-spain",
"category": "Localisation/Europe",
Expand Down
32 changes: 14 additions & 18 deletions l10n_es_partner/gen_src/gen_data_banks.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def gen_bank_data_xml(src_path, dest_path):
try:
reader = XlsDictReader(src_path)
except OSError: # pragma: no cover
_logger.error("File '%s' not found." % src_path)
_logger.error(f"File {src_path} not found.")
return
# Preparar el archivo resultante
output = codecs.open(dest_path, mode="w", encoding="utf-8")
Expand All @@ -148,7 +148,7 @@ def gen_bank_data_xml(src_path, dest_path):
for row in reader:
if row["FCHBAJA"]:
continue
name = "res_bank_es_%s" % row["COD_BE"]
name = f'res_bank_es_{row["COD_BE"]}'
numero = (
int(row["NUMEROVIA"])
if isinstance(row["NUMEROVIA"], float)
Expand All @@ -157,7 +157,7 @@ def gen_bank_data_xml(src_path, dest_path):
street = "{}. {}, {}".format(
row["SIGLAVIA"].title(), row["NOMBREVIA"].title(), numero
)
output.write(indent + '<record id="%s" model="res.bank">\n' % name)
output.write(indent + f'<record id="{name}" model="res.bank">\n')
output.write(
indent * 2
+ '<field name="name">{}</field>\n'.format(
Expand All @@ -166,43 +166,39 @@ def gen_bank_data_xml(src_path, dest_path):
)
output.write(
indent * 2
+ '<field name="lname">%s</field>\n' % escape(row["NOMBRE105"].title())
+ f'<field name="lname">{escape(row["NOMBRE105"].title())}</field>\n'
)
output.write(
indent * 2 + '<field name="code">%s</field>\n' % escape(row["COD_BE"])
indent * 2 + f'<field name="code">{escape(row["COD_BE"])}</field>\n'
)
# Han quitado el BIC del listado - Lo busco en una tabla estática
if bics.get(row["COD_BE"]):
output.write(
indent * 2 + '<field name="bic">%s</field>\n' % bics[row["COD_BE"]]
indent * 2 + f'<field name="bic">{bics[row["COD_BE"]]}</field>\n'
)
output.write(' <field name="street">%s</field>\n' % escape(street))
output.write(f' <field name="street">{escape(street)}</field>\n')
if row["RESTODOM"]:
output.write(
indent * 2
+ '<field name="street2">%s</field>\n' % escape(row["RESTODOM"].title())
+ f'<field name="street2">{escape(row["RESTODOM"].title())}</field>\n'
)
if row["DIRINTERNET"]:
output.write(
indent * 2
+ '<field name="website">%s</field>\n'
% escape(row["DIRINTERNET"].lower())
indent * 2 + f'<field name="website">'
f'{escape(row["DIRINTERNET"].lower())}</field>\n'
)
if row["CODIGOCIF"]:
output.write(
indent * 2 + '<field name="vat">%s</field>\n' % escape(row["CODIGOCIF"])
indent * 2 + f'<field name="vat">{escape(row["CODIGOCIF"])}</field>\n'
)
output.write(
indent * 2
+ '<field name="city">%s</field>\n' % escape(row["POBLACION"].title())
)
output.write(
' <field name="zip">%s</field>\n' % escape(row["CODPOSTAL"])
+ f'<field name="city">{escape(row["POBLACION"].title())}</field>\n'
)
output.write(f' <field name="zip">{escape(row["CODPOSTAL"])}</field>\n')
if row["TELEFONO"]:
output.write(
indent * 2
+ '<field name="phone">%s</field>\n' % escape(row["TELEFONO"])
indent * 2 + f'<field name="phone">{escape(row["TELEFONO"])}</field>\n'
)
output.write(' <field eval="1" name="active"/>\n')
if row["CODPOSTAL"]:
Expand Down
3 changes: 3 additions & 0 deletions l10n_es_partner/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ Configuración \> Técnico \> Parámetros \> Parámetros del sistema
Seleccionar la clave l10n_es_partner.name_pattern Definir el patron
utilizando las etiquetas *%(name)s* para nombre y *%(comercial_name)s*
para nombre comercial.

Para importar los datos de los bancos españoles hay que ir a
Facturación \> Configuración \> Import spanish bank data
3 changes: 2 additions & 1 deletion l10n_es_partner/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
- Ismael Calvo \<<[email protected]>\>
- Carlos Dauden \<<[email protected]>\>
- Manuel Regidor \<<[email protected]>\>
- [APSL](https://apsl.tech):
- [APSL - Nagarro](https://apsl.tech):
- Javier Antó \<<[email protected]>\>
- Miquel Pascual \<<[email protected]>\>
- [Dixmit](https://www.dixmit.com):
- Enric Tobella
21 changes: 12 additions & 9 deletions l10n_es_partner/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,19 +369,19 @@ <h1 class="title">Adaptación de los clientes, proveedores y bancos para España
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2bbab6d2a8fd2b53be5925192c9cefb012b11dd8c12a4713d37080831863c9ad
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-spain/tree/17.0/l10n_es_partner"><img alt="OCA/l10n-spain" src="https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-spain-17-0/l10n-spain-17-0-l10n_es_partner"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-spain/tree/18.0/l10n_es_partner"><img alt="OCA/l10n-spain" src="https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-spain-18-0/l10n-spain-18-0-l10n_es_partner"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Incluye la siguiente funcionalidad:</p>
<ul class="simple">
<li>Añade el campo <em>Nombre comercial</em> a las empresas y permite buscar por
él.</li>
<li>Permite definir un patrón del nombre a mostrar a partir del nombre y
el nombre comercial de la empresa.</li>
<li>Añade los campos nombre largo, NIF y web a los bancos.</li>
<li>Añade los datos de los bancos españoles extraídos del registro oficial
del Banco de España (<a class="reference external" href="http://goo.gl/mtx6ic">http://goo.gl/mtx6ic</a>). El asistente realiza la
descarga automática de Internet, pero si por cualquier razón hay algún
problema, existe una copia local cuya última actualización fue el
26/10/2017.</li>
<li>Añade los datos de los bancos españoles extraídos del registro
oficial del Banco de España (<a class="reference external" href="http://goo.gl/mtx6ic">http://goo.gl/mtx6ic</a>). El asistente
realiza la descarga automática de Internet, pero si por cualquier
razón hay algún problema, existe una copia local cuya última
actualización fue el 26/10/2017.</li>
</ul>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand Down Expand Up @@ -416,6 +416,8 @@ <h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1>
Seleccionar la clave l10n_es_partner.name_pattern Definir el patron
utilizando las etiquetas <em>%(name)s</em> para nombre y <em>%(comercial_name)s</em>
para nombre comercial.</p>
<p>Para importar los datos de los bancos españoles hay que ir a Facturación
&gt; Configuración &gt; Import spanish bank data</p>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
Expand All @@ -428,7 +430,7 @@ <h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-spain/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/l10n-spain/issues/new?body=module:%20l10n_es_partner%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/l10n-spain/issues/new?body=module:%20l10n_es_partner%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -451,8 +453,9 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<li>Ismael Calvo &lt;<a class="reference external" href="mailto:ismael.calvo&#64;factorlibre.com">ismael.calvo&#64;factorlibre.com</a>&gt;</li>
<li>Carlos Dauden &lt;<a class="reference external" href="mailto:carlos.dauden&#64;tecnativa.com">carlos.dauden&#64;tecnativa.com</a>&gt;</li>
<li>Manuel Regidor &lt;<a class="reference external" href="mailto:manuel.regidor&#64;sygel.es">manuel.regidor&#64;sygel.es</a>&gt;</li>
<li><a class="reference external" href="https://apsl.tech">APSL</a>:<ul>
<li><a class="reference external" href="https://apsl.tech">APSL - Nagarro</a>:<ul>
<li>Javier Antó &lt;<a class="reference external" href="mailto:janto&#64;apsl.net">janto&#64;apsl.net</a>&gt;</li>
<li>Miquel Pascual &lt;<a class="reference external" href="mailto:mpascual&#64;apsl.net">mpascual&#64;apsl.net</a>&gt;</li>
</ul>
</li>
<li><a class="reference external" href="https://www.dixmit.com">Dixmit</a>:<ul>
Expand All @@ -472,7 +475,7 @@ <h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/pedrobaeza"><img alt="pedrobaeza" src="https://github.com/pedrobaeza.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-spain/tree/17.0/l10n_es_partner">OCA/l10n-spain</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-spain/tree/18.0/l10n_es_partner">OCA/l10n-spain</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
3 changes: 0 additions & 3 deletions l10n_es_partner/wizard/l10n_es_partner_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,16 @@

class L10nEsPartnerImportWizard(models.TransientModel):
_name = "l10n.es.partner.import.wizard"
_inherit = "res.config.installer"
_description = "l10n es partner import wizard"

import_fail = fields.Boolean(default=False)

def import_local(self):
res = super().execute()
path = os.path.join("l10n_es_partner", "wizard", "data_banks.xml")
with tools.file_open(path) as fp:
tools.convert_xml_import(
self.env, "l10n_es_partner", fp, {}, "init", noupdate=True
)
return res

def execute(self):
import requests
Expand Down
Loading

0 comments on commit 0f17c60

Please sign in to comment.