From 2b477f6b9d248578b5d4fb54664bc718d078f04c Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 3 Apr 2020 19:42:42 +0200 Subject: [PATCH] [FIX] base_location_geonames_import: Error on else code Introducing second variable has provoked an error on that part. --- base_location_geonames_import/__manifest__.py | 2 +- base_location_geonames_import/wizard/geonames_import.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/base_location_geonames_import/__manifest__.py b/base_location_geonames_import/__manifest__.py index ea7727133..cdc2b770c 100644 --- a/base_location_geonames_import/__manifest__.py +++ b/base_location_geonames_import/__manifest__.py @@ -8,7 +8,7 @@ { "name": "Base Location Geonames Import", - "version": "13.0.1.0.1", + "version": "13.0.1.0.2", "category": "Partner Management", "license": "AGPL-3", "summary": "Import zip entries from Geonames", diff --git a/base_location_geonames_import/wizard/geonames_import.py b/base_location_geonames_import/wizard/geonames_import.py index 46e351624..69e7f9cdd 100644 --- a/base_location_geonames_import/wizard/geonames_import.py +++ b/base_location_geonames_import/wizard/geonames_import.py @@ -79,8 +79,8 @@ class CityZipGeonamesImport(models.TransientModel): "WHERE name = %s AND country_id = %s AND state_id = %s LIMIT 1", (self.transform_city_name(row[2], country), country.id, state_id), ) - row = self.env.cr.fetchone() - return (row[0], row[1]) if row else (False, False) + row_city = self.env.cr.fetchone() + return (row_city[0], row_city[1]) if row_city else (False, False) @api.model def select_zip(self, row, country, state_id): @@ -171,7 +171,7 @@ class CityZipGeonamesImport(models.TransientModel): city_id, city_name = ( self.select_city(row, self.country_id, state_id) if search_cities - else False + else (False, False) ) if not city_id: city_vals = self.prepare_city(row, self.country_id, state_id)