Browse Source

Merge PR #958 into 12.0

Signed-off-by pedrobaeza
12.0
OCA-git-bot 4 years ago
parent
commit
d4b7edc5fa
  1. 5
      base_location_nuts/wizard/nuts_import.py

5
base_location_nuts/wizard/nuts_import.py

@ -176,7 +176,10 @@ class NutsImport(models.TransientModel):
if nuts: if nuts:
nuts.filtered(lambda n: not n.not_updatable).write(data) nuts.filtered(lambda n: not n.not_updatable).write(data)
else: 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: if level >= 1 and level <= 4:
self._parents[level - 1] = nuts.id self._parents[level - 1] = nuts.id
return nuts return nuts

Loading…
Cancel
Save