[ADD] Hotel Node Helper

This module is for providing helper functions to the hotel node master module.
This commit is contained in:
Pablo
2018-10-18 17:58:08 +02:00
parent 9fb96931f0
commit bb88d2b285
8 changed files with 75 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import inherited_hotel_room_type

View File

@@ -0,0 +1,22 @@
# Copyright 2018 Pablo Q. Barriuso
# Copyright 2018 Alexandre Díaz
# Copyright 2018 Dario Lodeiros
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import wdb
from odoo import models, fields, api
class HotelRoomType(models.Model):
_inherit = 'hotel.room.type'
@api.model
def check_availability_room_ids(self, dfrom, dto,
room_type_id=False, notthis=[]):
"""
Check availability for all or specific room types between dates
@return: A list of `ids` with free rooms
"""
free_rooms = super().check_availability_room(dfrom, dto, room_type_id, notthis)
return free_rooms.ids