From ea1e6b5ca9651f6beaca76f2021fab750f6ba19d Mon Sep 17 00:00:00 2001 From: miguelpadin Date: Thu, 2 Dec 2021 15:08:23 +0100 Subject: [PATCH] [FIX] pms_l10n_es: avoid to attempt to send traveller report if institution is not configured --- pms_l10n_es/models/pms_property.py | 2 +- pms_l10n_es/wizards/traveller_report.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pms_l10n_es/models/pms_property.py b/pms_l10n_es/models/pms_property.py index 83e4d434a..86d44a72b 100644 --- a/pms_l10n_es/models/pms_property.py +++ b/pms_l10n_es/models/pms_property.py @@ -19,8 +19,8 @@ class PmsProperty(models.Model): ("mossos", "Mossos_d'esquadra (soon)"), ], string="Institution", - default="guardia_civil", help="Institution to send daily guest data.", + required=False, ) institution_property_id = fields.Char( string="Institution property id", diff --git a/pms_l10n_es/wizards/traveller_report.py b/pms_l10n_es/wizards/traveller_report.py index 9f3a6381e..c49dd3967 100644 --- a/pms_l10n_es/wizards/traveller_report.py +++ b/pms_l10n_es/wizards/traveller_report.py @@ -469,4 +469,5 @@ class TravellerReport(models.TransientModel): @api.model def send_file_institution_async(self): for prop in self.env["pms.property"].search([]): - self.with_delay().send_file_institution(prop) + if prop.institution: + self.with_delay().send_file_institution(prop)