From 7881ee1e88a0ecf4d78d05f12883fafa96b53d99 Mon Sep 17 00:00:00 2001 From: Dario Lodeiros Date: Mon, 20 May 2019 16:50:54 +0200 Subject: [PATCH] [FIX] Police wizard only checkins on booking state --- hotel_l10n_es/wizard/police_wizard.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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")