diff --git a/hotel/data/hotel_demo.xml b/hotel/data/hotel_demo.xml index 042b7d0b9..50be034ab 100644 --- a/hotel/data/hotel_demo.xml +++ b/hotel/data/hotel_demo.xml @@ -193,6 +193,7 @@ False 1 True + True diff --git a/hotel/models/inherited_product_template.py b/hotel/models/inherited_product_template.py index 5a1409757..5a7ba560d 100644 --- a/hotel/models/inherited_product_template.py +++ b/hotel/models/inherited_product_template.py @@ -1,7 +1,8 @@ # Copyright 2017 Alexandre Díaz # Copyright 2017 Dario Lodeiros # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields +from odoo import models, fields + class ProductTemplate(models.Model): _inherit = "product.template" @@ -10,3 +11,5 @@ class ProductTemplate(models.Model): per_person = fields.Boolean('Unit increment per person') daily_limit = fields.Integer('Daily limit') is_extra_bed = fields.Boolean('Is extra bed', default=False) + is_popoverable = fields.Boolean('Show in Popover', default=False, + help='Specifies if the product is shown in the popover information.') diff --git a/hotel/views/inherited_product_template_views.xml b/hotel/views/inherited_product_template_views.xml index 1f99d3e0a..c4233cbc7 100644 --- a/hotel/views/inherited_product_template_views.xml +++ b/hotel/views/inherited_product_template_views.xml @@ -12,6 +12,7 @@ + diff --git a/hotel_calendar/models/bus_hotel_calendar.py b/hotel_calendar/models/bus_hotel_calendar.py index d9595a4dc..d369e8134 100644 --- a/hotel_calendar/models/bus_hotel_calendar.py +++ b/hotel_calendar/models/bus_hotel_calendar.py @@ -73,6 +73,7 @@ class BusHotelCalendar(models.TransientModel): 'real_dates': vals['real_dates'], 'channel_type': vals['channel_type'], 'board_service_name': vals['board_service_name'], + 'services': vals['services'], } } diff --git a/hotel_calendar/models/inherited_hotel_reservation.py b/hotel_calendar/models/inherited_hotel_reservation.py index 5190f5be2..b09100838 100644 --- a/hotel_calendar/models/inherited_hotel_reservation.py +++ b/hotel_calendar/models/inherited_hotel_reservation.py @@ -121,6 +121,7 @@ class HotelReservation(models.Model): 'real_dates': [reserv['real_checkin'], reserv['real_checkout']], # TODO: Add Board Services and Extra Service as Cradle, Bed, ... 'board_service_name': reserv['board_service_name'], + 'services': reserv['services'], } }) @@ -195,6 +196,8 @@ class HotelReservation(models.Model): rp.mobile, rp.phone, rp.email, rp.name as partner_name, pt.name as room_type, + + array_agg(pt2.name) FILTER (WHERE pt2.is_popoverable = TRUE) as services, rcr.name as closure_reason, @@ -209,11 +212,15 @@ class HotelReservation(models.Model): ON hf.closure_reason_id = rcr.id LEFT JOIN hotel_board_service_room_type_rel AS hbsrt ON hr.board_service_room_id = hbsrt.id LEFT JOIN hotel_board_service AS hbs ON hbsrt.hotel_board_service_id = hbs.id + LEFT JOIN hotel_service AS hs ON hr.id = hs.ser_room_line + LEFT JOIN product_product AS pp2 ON hs.product_id = pp2.id + LEFT JOIN product_template AS pt2 ON pp2.product_tmpl_id = pt2.id WHERE room_id IN %s AND ( (checkin <= %s AND checkout >= %s AND checkout <= %s) OR (checkin >= %s AND checkout <= %s) OR (checkin >= %s AND checkin <= %s AND checkout >= %s) OR (checkin <= %s AND checkout >= %s)) + GROUP BY hr.id, hf.id, pt.name, rcr.name, hbs.name, rp.mobile, rp.phone, rp.email, rp.name ORDER BY checkin DESC, checkout ASC, adults DESC, children DESC ''', (tuple(rooms.ids), rdfrom_str, rdfrom_str, dto_str, @@ -418,6 +425,8 @@ class HotelReservation(models.Model): 'real_dates': [self.real_checkin, self.real_checkout], 'channel_type': self.channel_type, 'board_service_name': self.board_service_room_id.hotel_board_service_id.name, + 'services': [service.product_id.name for service in self.service_ids + if service.product_id.is_popoverable], } @api.multi diff --git a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js index 74f9e551b..c69dfcb81 100644 --- a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js +++ b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js @@ -761,6 +761,7 @@ var PMSCalendarController = AbstractController.extend({ 'splitted': tp['splitted'], 'channel_type': tp['channel_type'], 'board_service_name': tp['board_service_name'], + 'services': tp['services'], }; }, diff --git a/hotel_calendar/static/src/xml/hotel_calendar_templates.xml b/hotel_calendar/static/src/xml/hotel_calendar_templates.xml index 0aec1b994..f257642d6 100644 --- a/hotel_calendar/static/src/xml/hotel_calendar_templates.xml +++ b/hotel_calendar/static/src/xml/hotel_calendar_templates.xml @@ -131,9 +131,14 @@
- - This reservation is part of splitted reservation. You can check it in the corresponding Folio. - +
+ + This reservation requires: + + +

This reservation is part of splitted reservation. You can check it in the corresponding Folio.

+
+
@@ -255,6 +260,7 @@ +