Browse Source

[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.
14.0
Ivàn Todorovich 4 years ago
parent
commit
fd6e03e8b3
  1. 2
      base_location_geonames_import/wizard/geonames_import.py

2
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:

Loading…
Cancel
Save