Browse Source

base_location_geonames_import: fix country.code according to new data format

pull/268/head
Alex Comba 9 years ago
parent
commit
def6962852
  1. 4
      base_location_geonames_import/wizard/geonames_import.py

4
base_location_geonames_import/wizard/geonames_import.py

@ -60,11 +60,11 @@ class BetterZipGeonamesImport(models.TransientModel):
@api.model @api.model
def create_better_zip(self, row, country): def create_better_zip(self, row, country):
if row[0] != country.code:
if row[8] != country.code:
raise UserError( raise UserError(
_("The country code inside the file (%s) doesn't " _("The country code inside the file (%s) doesn't "
"correspond to the selected country (%s).") "correspond to the selected country (%s).")
% (row[0], country.code))
% (row[8], country.code))
logger.debug('ZIP = %s - City = %s' % (row[1], row[2])) logger.debug('ZIP = %s - City = %s' % (row[1], row[2]))
if (self.title_case): if (self.title_case):
row[2] = row[2].title() row[2] = row[2].title()

Loading…
Cancel
Save