139 lines
4.6 KiB
Python
139 lines
4.6 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
import requests
|
|
import logging
|
|
from odoo import models, fields, api, _
|
|
from datetime import datetime, timedelta
|
|
|
|
|
|
_logger = logging.getLogger(__name__)
|
|
|
|
STATES = ['Active', 'Cancelled']
|
|
|
|
|
|
class HmsEmail(models.Model):
|
|
_name = 'hms.email'
|
|
_description = 'Hms Email'
|
|
_rec_name = 'email'
|
|
|
|
email = fields.Char(string="Email")
|
|
|
|
|
|
class HmsPhones(models.Model):
|
|
_name = 'hms.phones'
|
|
_description = 'Hms Phones'
|
|
_rec_name = 'phone'
|
|
|
|
phone = fields.Char(string="Phone")
|
|
|
|
|
|
class HmsCustomer(models.Model):
|
|
_name = 'hms.customer'
|
|
_description = 'Hms Customer'
|
|
_rec_name = 'bid'
|
|
|
|
bid = fields.Char(string="Customer ID", index=True)
|
|
lastName = fields.Char(string="Last Name")
|
|
firstName = fields.Char(string="First Name")
|
|
middleName = fields.Char(string="Middle Name")
|
|
birthDate = fields.Char(string="Birth Date")
|
|
citizenshipCode = fields.Char(string="Citizenship Code")
|
|
status = fields.Json(string="Status")
|
|
emails = fields.Many2many(comodel_name="hms.email", string="Emails")
|
|
phones = fields.Many2many(comodel_name="hms.phones", string="Phones")
|
|
gender = fields.Char(string="Gender")
|
|
|
|
|
|
class HmsRooms(models.Model):
|
|
_name = 'hms.rooms'
|
|
_description = 'Hms Rooms'
|
|
_rec_name = 'name'
|
|
|
|
bid = fields.Char(string="Room ID", index=True)
|
|
name = fields.Char(string="Name")
|
|
roomTypeId = fields.Char(string="Room Type ID")
|
|
floorId = fields.Char(string="Floor ID")
|
|
|
|
|
|
class HmsGuests(models.Model):
|
|
_name = 'hms.guests'
|
|
_description = 'Hms Guests'
|
|
_rec_name = 'bid'
|
|
|
|
bid = fields.Char(string="Guest ID", index=True)
|
|
lastName = fields.Char(string="Last Name")
|
|
firstName = fields.Char(string="First Name")
|
|
middleName = fields.Char(string="Middle Name")
|
|
birthDate = fields.Char(string="Birth Date")
|
|
citizenshipCode = fields.Char(string="Citizenship Code")
|
|
status = fields.Json(string="Status")
|
|
emails = fields.Many2many(comodel_name="hms.email", string="Emails")
|
|
phones = fields.Many2many(comodel_name="hms.phones", string="Phones")
|
|
gender = fields.Char(string="Gender")
|
|
|
|
|
|
class HmsAmenities(models.Model):
|
|
_name = 'hms.amenities'
|
|
_description = 'Hms Amenities'
|
|
_rec_name = 'name'
|
|
|
|
name = fields.Char(string="Name")
|
|
|
|
|
|
class HmsRoomStays(models.Model):
|
|
_name = 'hms.roomstays'
|
|
_description = 'Hms RoomStays'
|
|
_rec_name = 'bid'
|
|
|
|
bid = fields.Char(string="Room raw ID", index=True)
|
|
bookingId = fields.Char(string="Booking ID", index=True)
|
|
roomId = fields.Many2one(comodel_name="hms.rooms", string="Room ID")
|
|
roomTypeId = fields.Char(string="Room Type ID")
|
|
guestsIds = fields.Many2many(comodel_name="hms.guests", string="Guests Ids")
|
|
checkInDateTime = fields.Char(string="Check In Date Time")
|
|
checkOutDateTime = fields.Char(string="Check Out Date Time")
|
|
actualCheckInDateTime = fields.Char(string="Actual Check In Date Time")
|
|
actualCheckOutDateTime = fields.Char(string="Actual Check Out Date Time")
|
|
status = fields.Char(string="Status")
|
|
bookingStatus = fields.Char(string="Booking Status")
|
|
guestCountInfo = fields.Json(string="Guest Count Info")
|
|
totalPrice = fields.Json(string="Total Price")
|
|
amenities = fields.Many2many(comodel_name="hms.amenities", string="Amenities")
|
|
|
|
bookings_id = fields.Many2one(comodel_name="hms.bookings", string="Room Stay Id")
|
|
|
|
|
|
|
|
|
|
class HmsBookings(models.Model):
|
|
_name = 'hms.bookings'
|
|
_description = 'Hms Bookings'
|
|
_rec_name = 'bid'
|
|
|
|
bid = fields.Char(string="Booking ID", index=True)
|
|
number = fields.Char(string="Booking Number", index=True)
|
|
customerLanguage = fields.Char(string="Customer Language")
|
|
visitPurpose = fields.Json(string="Visit Purpose")
|
|
customerComment = fields.Char(string="Customer Comment")
|
|
lastModified = fields.Char(string="Last Modified")
|
|
groupName = fields.Char(string="Group Name")
|
|
currencyId = fields.Char(string="Currency ID")
|
|
customer = fields.Many2one(comodel_name="hms.customer", string="Customer")
|
|
roomStays = fields.One2many(comodel_name="hms.roomstays", inverse_name="bookings_id", string="RoomStays")
|
|
customerCompany = fields.Json(string="Customer Company")
|
|
source = fields.Json(string="RoomStays (Json)")
|
|
sourceChannelName = fields.Char(string="Source Channel Name")
|
|
|
|
|
|
class HmsStatus(models.Model):
|
|
_name = 'hms.status'
|
|
_description = 'Hms Status'
|
|
|
|
name = fields.Char(string="Status", required=True)
|
|
|
|
|
|
class HmsBookingStatus(models.Model):
|
|
_name = 'hms.booking.status'
|
|
_description = 'Hms Booking Status'
|
|
|
|
name = fields.Char(string="Booking Status", required=True) |