From 4ab27a0dcc94d925a7fd765fce26ad5f3f877505 Mon Sep 17 00:00:00 2001 From: QS5ELkMu Date: Thu, 30 Aug 2018 17:51:19 +0200 Subject: [PATCH] [WIP][FIX] Calendar --- hotel_calendar/models/inherited_hotel_reservation.py | 5 ++--- hotel_calendar/models/inherited_ir_default.py | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hotel_calendar/models/inherited_hotel_reservation.py b/hotel_calendar/models/inherited_hotel_reservation.py index 9dcd7bd47..c4a3b514c 100644 --- a/hotel_calendar/models/inherited_hotel_reservation.py +++ b/hotel_calendar/models/inherited_hotel_reservation.py @@ -108,10 +108,9 @@ class HotelReservation(models.Model): date_start = date_utils.get_datetime(dfrom, hours=False) \ - timedelta(days=1) date_start_str = date_start.strftime(DEFAULT_SERVER_DATETIME_FORMAT) - room_product_ids = rooms.mapped('product_id.id') reservations_raw = self.env['hotel.reservation'].search( [ - ('product_id', 'in', room_product_ids), + ('room_id', 'in', rooms.ids), ('state', 'in', ['draft', 'confirm', 'booking', 'done', False]), ], @@ -141,7 +140,7 @@ class HotelReservation(models.Model): vrooms = self.env['hotel.room.type'].search( [], order='hcal_sequence ASC') - vroom_pr_cached_obj = self.env['virtual.room.pricelist.cached'] + vroom_pr_cached_obj = self.env['room.pricelist.cached'] for vroom in vrooms: days = {} diff --git a/hotel_calendar/models/inherited_ir_default.py b/hotel_calendar/models/inherited_ir_default.py index f254607a3..fcb710712 100644 --- a/hotel_calendar/models/inherited_ir_default.py +++ b/hotel_calendar/models/inherited_ir_default.py @@ -13,13 +13,13 @@ class IrDefault(models.Model): super(IrDefault, self).set(model_name, field_name, value, user_id, company_id, condition) if model_name == 'res.config.settings' and field_name == 'parity_pricelist_id': pricelist_id = int(value) - self.env['virtual.room.pricelist.cached'].search([]).unlink() + self.env['room.pricelist.cached'].search([]).unlink() pricelist_items = self.env['product.pricelist.item'].search([ ('pricelist_id', '=', pricelist_id) ]) vroom_obj = self.env['hotel.room.type'] - vroom_pr_cached_obj = self.env['virtual.room.pricelist.cached'] + vroom_pr_cached_obj = self.env['room.pricelist.cached'] for pitem in pricelist_items: date_start = pitem.date_start product_tmpl_id = pitem.product_tmpl_id.id