diff --git a/hotel/__manifest__.py b/hotel/__manifest__.py index 05a1ff765..ff768ccc2 100644 --- a/hotel/__manifest__.py +++ b/hotel/__manifest__.py @@ -51,7 +51,6 @@ 'views/hotel_service_line_views.xml', 'views/hotel_board_service_views.xml', 'views/hotel_checkin_partner_views.xml', - 'views/hotel_room_type_availability_views.xml', 'views/hotel_board_service_room_type_views.xml', 'data/cron_jobs.xml', 'data/records.xml', diff --git a/hotel/models/__init__.py b/hotel/models/__init__.py index 46cfdf7ff..dbb314957 100644 --- a/hotel/models/__init__.py +++ b/hotel/models/__init__.py @@ -20,7 +20,6 @@ from . import hotel_room_type_restriction from . import hotel_room_type_restriction_item from . import hotel_reservation_line from . import hotel_checkin_partner -from . import hotel_room_type_availability from . import inherited_product_pricelist from . import res_config from . import inherited_res_partner diff --git a/hotel/models/hotel_room_type_availability.py b/hotel/models/hotel_room_type_availability.py deleted file mode 100644 index 84a076182..000000000 --- a/hotel/models/hotel_room_type_availability.py +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2017 Alexandre Díaz -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields, api, _ -from odoo.exceptions import ValidationError - - -class HotelRoomTypeAvailability(models.Model): - _name = 'hotel.room.type.availability' - _inherit = 'mail.thread' - - room_type_id = fields.Many2one('hotel.room.type', 'Room Type', - required=True, track_visibility='always', - ondelete='cascade') - avail = fields.Integer('Avail', default=0, track_visibility='always') - date = fields.Date('Date', required=True, track_visibility='always') - - _sql_constraints = [ - ('room_type_registry_unique', - 'unique(room_type_id, date)', - 'Only can exists one availability in the same day for the same room type!') - ] - - @api.constrains('avail') - def _check_avail(self): - for record in self: - if record.avail < 0: - record.avail = 0 - else: - room_type_obj = self.env['hotel.room.type'] - cavail = len(room_type_obj.check_availability_room_type( - record.date, - record.date, - room_type_id=record.room_type_id.id)) - max_avail = min(cavail, record.room_type_id.total_rooms_count) - if record.avail > max_avail: - record.avail = max_avail diff --git a/hotel/views/hotel_room_type_availability_views.xml b/hotel/views/hotel_room_type_availability_views.xml deleted file mode 100644 index 93d369dc9..000000000 --- a/hotel/views/hotel_room_type_availability_views.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - hotel.room.type.availability.form - hotel.room.type.availability - -
- - - -

-
- - - - -
-
- - -
-
-
-
- - - - hotel.room.type.availability.tree - hotel.room.type.availability - - - - - - - - - - - - - Virtual Room Availability - hotel.room.type.availability - form - tree,form - - - - - -
diff --git a/hotel_channel_connector/views/channel_hotel_room_type_availability_views.xml b/hotel_channel_connector/views/channel_hotel_room_type_availability_views.xml index cc6eea044..86fe8c357 100644 --- a/hotel_channel_connector/views/channel_hotel_room_type_availability_views.xml +++ b/hotel_channel_connector/views/channel_hotel_room_type_availability_views.xml @@ -11,7 +11,7 @@ - + @@ -27,7 +27,7 @@ - +