diff --git a/l10n_es_partner/gen_src/README.rst b/l10n_es_partner/gen_src/README.rst new file mode 100644 index 0000000000..94c93a8f18 --- /dev/null +++ b/l10n_es_partner/gen_src/README.rst @@ -0,0 +1,15 @@ +Utilidad para generar el archivo de bancos apartir de la información del Banco +============================================================================== +de España +========= + +NOTA: Necesita la librería python 'xlrd' + +1. Descargar el excel de las 'Entidades con establecimiento' de la web del +Banco de España: +http://goo.gl/EPfcR5 +2. Mover el archivo descargado 'REGBANESP_CONESTAB_A.XLS' a la carpeta gen_src +3. Ejecutar: + python gen_data_banks.py +4. Se generará un archivo data_banks.xml en la carpeta wizard que sustituirá el +anterior diff --git a/l10n_es_partner/gen_src/README.txt b/l10n_es_partner/gen_src/README.txt deleted file mode 100644 index 9e050f6622..0000000000 --- a/l10n_es_partner/gen_src/README.txt +++ /dev/null @@ -1,36 +0,0 @@ -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (c) 2014 Factor Libre S.L (http://www.factorlibre.com) -# Ismael Calvo -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -Utilidad para generar el archivo de bancos apartir de la información del Banco -============================================================================== -de España -========= - -NOTA: Necesita la librería python 'xlrd' - -1. Descargar el excel de las 'Entidades con establecimiento' de la web del -Banco de España: -http://goo.gl/EPfcR5 -2. Mover el archivo descargado 'REGBANESP_CONESTAB_A.XLS' a la carpeta gen_src -3. Ejecutar: - python gen_data_banks.py -4. Se generará un archivo data_banks.xml en la carpeta wizard que sustituirá el -anterior diff --git a/l10n_es_partner/gen_src/gen_data_banks.py b/l10n_es_partner/gen_src/gen_data_banks.py index 2f8bb26ed8..f246256be8 100644 --- a/l10n_es_partner/gen_src/gen_data_banks.py +++ b/l10n_es_partner/gen_src/gen_data_banks.py @@ -44,34 +44,39 @@ # Genera los nuevos registros de los bancos for row_index in range(1, sheet.nrows): row = sheet.row_values(row_index) - name = "city_bank_" + row[40].lower().replace( - ' ', '_').replace(u'\xf1', 'n') - street = row[7] + '. ' + row[8] + ', ' + row[9] + ' ' + row[10] - output.write(' \n' % name) - output.write(' %s\n' % ( - row[40])) - output.write(' %s\n' % ( - row[4])) - output.write(' %s\n' % ( - row[1])) - output.write(' %s\n' % ( - row[6])) - output.write(' %s\n' % ( - street)) - output.write(' %s\n' % ( - row[12])) - output.write(' %s\n' % ( - row[11])) - output.write(' ' - '%s\n' % row[16]) - output.write(' %s\n' % ( - row[18])) - output.write(' \n') - output.write(' \n') - output.write(' \n') - output.write(' \n') + if row[29]: + name = "res_bank_" + row[40].lower().replace( + ' ', '').replace(',', '').replace('.', '').replace( + '-', '').replace(u'\xf1', 'n') + street = row[7] + '. ' + row[8] + ', ' + row[9] + ' ' + row[10] + output.write(' \n' % + name) + output.write(' %s\n' % ( + row[40])) + output.write(' %s\n' % ( + row[4])) + output.write(' %s\n' % ( + row[1])) + output.write(' %s\n' % ( + row[29])) + output.write(' %s\n' % ( + row[6])) + output.write(' %s\n' % + (street)) + output.write(' %s\n' % ( + row[12])) + output.write(' %s\n' % ( + row[11])) + output.write(' ' + '%s\n' % row[16]) + output.write(' %s\n' % ( + row[18])) + output.write(' %s\n' % + (row[19])) + output.write(' \n') + output.write(' \n') + output.write(' \n') output.write(" \n") output.write("\n")