From c06a4f043e24791a6c925194b1bbb4754b68fe5d Mon Sep 17 00:00:00 2001 From: sergiocorato Date: Wed, 9 Sep 2020 21:21:31 +0200 Subject: [PATCH] [12.0][FIX] base_location_nuts missing country_id --- base_location_nuts/wizard/nuts_import.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/base_location_nuts/wizard/nuts_import.py b/base_location_nuts/wizard/nuts_import.py index e50e65aed..5490cc866 100644 --- a/base_location_nuts/wizard/nuts_import.py +++ b/base_location_nuts/wizard/nuts_import.py @@ -176,7 +176,10 @@ class NutsImport(models.TransientModel): if nuts: nuts.filtered(lambda n: not n.not_updatable).write(data) else: - nuts = nuts_model.create(data) + if data.get('country_id', False): + nuts = nuts_model.create(data) + else: + logger.info(_('Missing country_id for %s') % data) if level >= 1 and level <= 4: self._parents[level - 1] = nuts.id return nuts