[FIX] default value for old_reservations

This commit is contained in:
Pablo
2019-06-05 12:53:23 +02:00
parent 2293a447ab
commit cb0b72c68f

View File

@@ -288,7 +288,7 @@ class HotelReservationImporter(Component):
'state': 'confirm', 'state': 'confirm',
}) })
@api.model() @api.model
def wubook_modification(self, reservations, book): def wubook_modification(self, reservations, book):
channel_room_type_obj = self.env['channel.hotel.room.type'] channel_room_type_obj = self.env['channel.hotel.room.type']
checkin_utc_dt, checkout_utc_dt = self._get_book_dates(book) checkin_utc_dt, checkout_utc_dt = self._get_book_dates(book)
@@ -394,6 +394,7 @@ class HotelReservationImporter(Component):
if book['was_modified'] and is_cancellation: if book['was_modified'] and is_cancellation:
continue continue
else: else:
old_reservations = False
reservations = self.env['channel.hotel.reservation'].search([ reservations = self.env['channel.hotel.reservation'].search([
('external_id', 'in', book['modified_reservations']), ('external_id', 'in', book['modified_reservations']),
('backend_id', '=', self.backend_record.id) ('backend_id', '=', self.backend_record.id)