diff --git a/hotel_l10n_es/wizard/police_wizard.py b/hotel_l10n_es/wizard/police_wizard.py index d8e85b638..3927215ab 100755 --- a/hotel_l10n_es/wizard/police_wizard.py +++ b/hotel_l10n_es/wizard/police_wizard.py @@ -43,10 +43,10 @@ class PoliceWizard(models.TransientModel): def generate_file(self): company = self.env.user.company_id if company.police_number is not False and company.property_name is not False: - lines = self.env['hotel.checkin.partner'].search( - [('enter_date', - '=', - self.download_date)]) + lines = self.env['hotel.checkin.partner'].search([ + ('enter_date', '=', self.download_date), + ('state', 'in', ('booking', 'done')), + ]) content = "1|"+company.police_number+"|"+company.property_name.upper()[0:40] content += "|" content += datetime.datetime.now().strftime("%Y%m%d|%H%M")