From 7e3a4e59722382512864c24f3d878b91a7a598b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Lodeiros?= Date: Thu, 12 May 2022 17:29:02 +0200 Subject: [PATCH] [IMP]pms_l10n_es: INE check ine code in states --- pms_l10n_es/wizards/wizard_ine.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pms_l10n_es/wizards/wizard_ine.py b/pms_l10n_es/wizards/wizard_ine.py index 308aeb4d3..ddac65f31 100644 --- a/pms_l10n_es/wizards/wizard_ine.py +++ b/pms_l10n_es/wizards/wizard_ine.py @@ -296,6 +296,13 @@ class WizardIne(models.TransientModel): ) # .ine_code ine_code = residence_state_id.ine_code + if not ine_code: + raise ValidationError( + _( + "%s does not have the INE Code configured" + % residence_state_id.name + ) + ) # get count of each result num_spain = entry_from_spain["__count"] @@ -675,7 +682,7 @@ class WizardIne(models.TransientModel): ("reservation_id.agency_id", "!=", False), ("reservation_id.agency_id.sale_channel_id.is_on_line", "=", False), ], - "percent_otas": [ + "otas": [ ("reservation_id.agency_id", "!=", False), ("reservation_id.agency_id.sale_channel_id.is_on_line", "=", True), ],