diff --git a/hotel/models/hotel_reservation.py b/hotel/models/hotel_reservation.py index aadd96521..7a4456a36 100644 --- a/hotel/models/hotel_reservation.py +++ b/hotel/models/hotel_reservation.py @@ -487,10 +487,13 @@ class HotelReservation(models.Model): res = {} checkin = values.get('checkin') checkout = values.get('checkout') - room_type = values.get('room_type_id') - if checkin and checkout and room_type: - room_chosen = self.env['hotel.room.type'].check_availability_room_type(checkin, checkout, room_type)[0] - # Check room_chosen exist + room_type_id = values.get('room_type_id') + if checkin and checkout and room_type_id: + if 'overbooking' not in values: + room_chosen = self.env['hotel.room.type'].check_availability_room_type(checkin, checkout, room_type_id)[0] + # Check room_chosen exist + else: + room_chosen = self.env['hotel.room.type'].browse(room_type_id).room_ids[0] res.update({ 'room_id': room_chosen.id }) diff --git a/hotel_channel_connector_wubook/models/hotel_reservation/importer.py b/hotel_channel_connector_wubook/models/hotel_reservation/importer.py index 0fd195369..f77b85891 100644 --- a/hotel_channel_connector_wubook/models/hotel_reservation/importer.py +++ b/hotel_channel_connector_wubook/models/hotel_reservation/importer.py @@ -364,7 +364,7 @@ class HotelReservationImporter(Component): notthis=used_rooms) if any(free_rooms): vals.update({ - 'product_id': room_type_bind.product_id.id, + 'room_type_id': room_type_bind.odoo_id.id, 'name': free_rooms[0].name, }) reservations.append((0, False, vals)) @@ -408,7 +408,7 @@ class HotelReservationImporter(Component): book, ) vals.update({ - 'product_id': room_type_bind.product_id.id, + 'room_type_id': room_type_bind.odoo_id.id, 'name': room_type_bind.name, 'overbooking': True, })