From 291b8f814d4098716bdf39dab902815b2b0c16a7 Mon Sep 17 00:00:00 2001 From: Pablo Date: Thu, 13 Dec 2018 18:45:40 +0100 Subject: [PATCH 1/2] [FIX] delete attribute applied_on references --- .../models/inherited_hotel_room_type_restriction_item.py | 3 +-- hotel_calendar/tests/test_management_calendar.py | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) 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..de9a8fedf 100644 --- a/hotel_calendar/models/inherited_hotel_room_type_restriction_item.py +++ b/hotel_calendar/models/inherited_hotel_room_type_restriction_item.py @@ -60,8 +60,7 @@ 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, 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)), From d974b5ee5dd9d4fdee149eb1fd3c4eb109c7b31a Mon Sep 17 00:00:00 2001 From: Pablo Date: Thu, 13 Dec 2018 18:47:21 +0100 Subject: [PATCH 2/2] [FIX] renamed field date_start --- .../models/inherited_hotel_room_type_restriction_item.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 de9a8fedf..486c58152 100644 --- a/hotel_calendar/models/inherited_hotel_room_type_restriction_item.py +++ b/hotel_calendar/models/inherited_hotel_room_type_restriction_item.py @@ -64,7 +64,7 @@ class HotelRoomTypeResrtrictionItem(models.Model): 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,