From fd6e03e8b3b2e55efd498790606df029a5ec503a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A0n=20Todorovich?= Date: Wed, 9 Jun 2021 11:00:11 -0300 Subject: [PATCH] [FIX] old_zip id may be removed more than once In that case, using remove would raise a KeyError. On the other hand, discard fails silently. --- base_location_geonames_import/wizard/geonames_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base_location_geonames_import/wizard/geonames_import.py b/base_location_geonames_import/wizard/geonames_import.py index 7c6ca0221..11a573828 100644 --- a/base_location_geonames_import/wizard/geonames_import.py +++ b/base_location_geonames_import/wizard/geonames_import.py @@ -224,7 +224,7 @@ class CityZipGeonamesImport(models.TransientModel): if zip_vals not in zip_vals_list: zip_vals_list.append(zip_vals) else: - old_zips.remove(zip_code.id) + old_zips.discard(zip_code.id) self.env["res.city.zip"].create(zip_vals_list) if not max_import: if old_zips: