diff --git a/hotel_calendar/models/inherited_hotel_room_type_restriction_item.py b/hotel_calendar/models/inherited_hotel_room_type_restriction_item.py index cfcde6493..486c58152 100644 --- a/hotel_calendar/models/inherited_hotel_room_type_restriction_item.py +++ b/hotel_calendar/models/inherited_hotel_room_type_restriction_item.py @@ -60,12 +60,11 @@ class HotelRoomTypeResrtrictionItem(models.Model): # Construct dictionary with relevant info of removed records unlink_vals = [] for record in self: - if record.restriction_id.id != restrictions_default_id or \ - record.applied_on != '0_room_type': + if record.restriction_id.id != restrictions_default_id: continue unlink_vals.append({ 'restriction_id': record.restriction_id.id, - 'date': record.date_start, + 'date': record.date, 'min_stay': 0, 'min_stay_arrival': 0, 'max_stay': 0, diff --git a/hotel_calendar/tests/test_management_calendar.py b/hotel_calendar/tests/test_management_calendar.py index 962dc208d..9a4b8b0e6 100644 --- a/hotel_calendar/tests/test_management_calendar.py +++ b/hotel_calendar/tests/test_management_calendar.py @@ -112,7 +112,6 @@ class TestManagementCalendar(TestHotelCalendar): rest_it_obj = self.env['hotel.room.type.restriction.item'].sudo( self.user_hotel_manager) rest_ids = rest_it_obj.search([ - ('applied_on', '=', '0_room_type'), ('restriction_id', '=', self.default_restriction_id), ('room_type_id', 'in', (self.hotel_room_type_budget.id, self.hotel_room_type_special.id)),