def cancel_reservation(self):
        """
        This method cancel record set for hotel room reservation line
        ------------------------------------------------------------------
        @param self: The object pointer
        @return: cancel record set for hotel room reservation line.
        """
        room_res_line_obj = self.env['hotel.room.reservation.line']
        hotel_res_line_obj = self.env['hotel_reservation.line']
        self.state = 'cancel'
        room_reservation_line = room_res_line_obj.search([('reservation_id',
                                                           'in', self.ids)])
        room_reservation_line.write({'state': 'unassigned'})
        room_reservation_line.unlink()
        reservation_lines = hotel_res_line_obj.search([('line_id',
                                                        'in', self.ids)])
        for reservation_line in reservation_lines:
            reservation_line.reserve.write({'isroom': True,
                                            'status': 'available'})
        return True
def cancel_reservation ( self ) : room_res_line_obj = self . env [ 'hotel.room.reservation.line' ] hotel_res_line_obj = self . env [ 'hotel_reservation.line' ] self . state = 'cancel' room_reservation_line = room_res_line_obj . search ( [ ( 'reservation_id' , 'in' , self . ids ) ] ) room_reservation_line . write ( { 'state' : 'unassigned' } ) room_reservation_line . unlink ( ) reservation_lines = hotel_res_line_obj . search ( [ ( 'line_id' , 'in' , self . ids ) ] ) for reservation_line in reservation_lines : reservation_line . reserve . write ( { 'isroom' : True , 'status' : 'available' } ) return True
This method cancel record set for hotel room reservation line
        ------------------------------------------------------------------
        @param self: The object pointer
        @return: cancel record set for hotel room reservation line.