From e3d6622c9d669bcae2cf27d15b8c8043ab5222ad Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 11 Apr 2014 22:59:13 +0200 Subject: [PATCH] Insist on the fact that the wizard deletes current better zip entries in the module description and in the wizard itself. Better error message when the country code inside the file is wrong. --- base_location_geonames_import/__openerp__.py | 2 +- .../i18n/base_location_geonames_import.pot | 16 ++++++------- base_location_geonames_import/i18n/fr.po | 24 +++++++++---------- .../wizard/geonames_import.py | 5 ++-- .../wizard/geonames_import_view.xml | 2 +- 5 files changed, 25 insertions(+), 24 deletions(-) diff --git a/base_location_geonames_import/__openerp__.py b/base_location_geonames_import/__openerp__.py index b3d9ad11a..bd5518843 100644 --- a/base_location_geonames_import/__openerp__.py +++ b/base_location_geonames_import/__openerp__.py @@ -31,7 +31,7 @@ Base Location Geonames Import ============================= -This module adds a wizard to import better zip entries from Geonames (http://download.geonames.org/export/zip/). +This module adds a wizard to import better zip entries from Geonames (http://download.geonames.org/export/zip/). When you start the wizard, it will ask you to select a country ; then, for the selected country, it will delete all the current better zip entries, download the latest version of the list of cities from geonames.org and create new better zip entries. Please contact Alexis de Lattre from Akretion for any help or question about this module. """, diff --git a/base_location_geonames_import/i18n/base_location_geonames_import.pot b/base_location_geonames_import/i18n/base_location_geonames_import.pot index d45e4e250..7c5782ea3 100644 --- a/base_location_geonames_import/i18n/base_location_geonames_import.pot +++ b/base_location_geonames_import/i18n/base_location_geonames_import.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-04-07 15:00+0000\n" -"PO-Revision-Date: 2014-04-07 15:00+0000\n" +"POT-Creation-Date: 2014-04-11 20:55+0000\n" +"PO-Revision-Date: 2014-04-11 20:55+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -26,19 +26,19 @@ msgid "Country" msgstr "" #. module: base_location_geonames_import -#: code:addons/base_location_geonames_import/wizard/geonames_import.py:64 -#: code:addons/base_location_geonames_import/wizard/geonames_import.py:87 +#: code:addons/base_location_geonames_import/wizard/geonames_import.py:66 +#: code:addons/base_location_geonames_import/wizard/geonames_import.py:90 #, python-format msgid "Error:" msgstr "" #. module: base_location_geonames_import #: view:better.zip.geonames.import:0 -msgid "For the country selected above, this wizard will delete all the current better zip entries, download the latest version of the list of cities from geonames.org and create new better zip entries." +msgid "For the country selected above, this wizard will DELETE ALL THE CURRENT BETTER ZIP ENTRIES, download the latest version of the list of cities from geonames.org and create new better zip entries." msgstr "" #. module: base_location_geonames_import -#: code:addons/base_location_geonames_import/wizard/geonames_import.py:88 +#: code:addons/base_location_geonames_import/wizard/geonames_import.py:91 #, python-format msgid "Got an error %d when trying to download the file %s." msgstr "" @@ -61,8 +61,8 @@ msgid "Import Geonames" msgstr "" #. module: base_location_geonames_import -#: code:addons/base_location_geonames_import/wizard/geonames_import.py:65 +#: code:addons/base_location_geonames_import/wizard/geonames_import.py:67 #, python-format -msgid "The content of the file doesn't correspond to the selected country." +msgid "The country code inside the file (%s) doesn't correspond to the selected country (%s)." msgstr "" diff --git a/base_location_geonames_import/i18n/fr.po b/base_location_geonames_import/i18n/fr.po index bfd7eebf9..699ad7519 100644 --- a/base_location_geonames_import/i18n/fr.po +++ b/base_location_geonames_import/i18n/fr.po @@ -6,9 +6,9 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-04-07 15:01+0000\n" -"PO-Revision-Date: 2014-04-07 15:01+0000\n" -"Last-Translator: Alexis de Lattre \n" +"POT-Creation-Date: 2014-04-11 20:56+0000\n" +"PO-Revision-Date: 2014-04-11 20:56+0000\n" +"Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -26,19 +26,19 @@ msgid "Country" msgstr "Pays" #. module: base_location_geonames_import -#: code:addons/base_location_geonames_import/wizard/geonames_import.py:64 -#: code:addons/base_location_geonames_import/wizard/geonames_import.py:87 +#: code:addons/base_location_geonames_import/wizard/geonames_import.py:66 +#: code:addons/base_location_geonames_import/wizard/geonames_import.py:90 #, python-format msgid "Error:" msgstr "Erreur :" #. module: base_location_geonames_import #: view:better.zip.geonames.import:0 -msgid "For the country selected above, this wizard will delete all the current better zip entries, download the latest version of the list of cities from geonames.org and create new better zip entries." -msgstr "Pour le pays sélectionné ci-dessus, cet assistant va supprimer toutes les entrées better zip, télécharger la dernière version de la liste des villes depuis geonames.org et créer de nouveaux enregistrements better zip." +msgid "For the country selected above, this wizard will DELETE ALL THE CURRENT BETTER ZIP ENTRIES, download the latest version of the list of cities from geonames.org and create new better zip entries." +msgstr "Pour le pays sélectionné ci-dessus, cet assistant va SUPPRIMER TOUTES LES ENTREES BETTER ZIP, télécharger la dernière version de la liste des villes depuis geonames.org et créer de nouveaux enregistrements better zip." #. module: base_location_geonames_import -#: code:addons/base_location_geonames_import/wizard/geonames_import.py:88 +#: code:addons/base_location_geonames_import/wizard/geonames_import.py:91 #, python-format msgid "Got an error %d when trying to download the file %s." msgstr "Erreur %d reçue suite à la tentative de téléchargement du fichier %s." @@ -51,7 +51,7 @@ msgstr "Importer" #. module: base_location_geonames_import #: model:ir.model,name:base_location_geonames_import.model_better_zip_geonames_import msgid "Import Better Zip from Geonames" -msgstr "Import Better Zip depuis Geonames" +msgstr "Import Better Zip from Geonames" #. module: base_location_geonames_import #: view:better.zip.geonames.import:0 @@ -61,8 +61,8 @@ msgid "Import Geonames" msgstr "Importer Geonames" #. module: base_location_geonames_import -#: code:addons/base_location_geonames_import/wizard/geonames_import.py:65 +#: code:addons/base_location_geonames_import/wizard/geonames_import.py:67 #, python-format -msgid "The content of the file doesn't correspond to the selected country." -msgstr "Le contenu du fichier ne correspond pas au pays sélectionné." +msgid "The country code inside the file (%s) doesn't correspond to the selected country (%s)." +msgstr "Le code pays utilisé à l'intérieur du fichier (%s) ne correspond pas au pays sélectionné (%s)." diff --git a/base_location_geonames_import/wizard/geonames_import.py b/base_location_geonames_import/wizard/geonames_import.py index aef0ee533..2d9db3ccf 100644 --- a/base_location_geonames_import/wizard/geonames_import.py +++ b/base_location_geonames_import/wizard/geonames_import.py @@ -64,8 +64,9 @@ class better_zip_geonames_import(orm.TransientModel): if row[0] != country_code: raise orm.except_orm( _('Error:'), - _("The content of the file doesn't correspond to the " - "selected country.")) + _("The country code inside the file (%s) doesn't " + "correspond to the selected country (%s).") + % (row[0], country_code)) logger.debug('ZIP = %s - City = %s' % (row[1], row[2])) if row[1] and row[2]: vals = self._prepare_better_zip( diff --git a/base_location_geonames_import/wizard/geonames_import_view.xml b/base_location_geonames_import/wizard/geonames_import_view.xml index f86ea17da..efd37057d 100644 --- a/base_location_geonames_import/wizard/geonames_import_view.xml +++ b/base_location_geonames_import/wizard/geonames_import_view.xml @@ -15,7 +15,7 @@
-