[FIX] Police wizard only checkins on booking state

This commit is contained in:
Dario Lodeiros
2019-05-20 16:50:54 +02:00
parent aad564fe48
commit 7881ee1e88

View File

@@ -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")