126 lines
4.3 KiB
Python
126 lines
4.3 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 ExelyEmail(models.Model):
|
|
_name = 'exely.email'
|
|
_description = 'Exely Email'
|
|
_rec_name = 'email'
|
|
|
|
email = fields.Char(string="Email")
|
|
|
|
|
|
class ExelyPhones(models.Model):
|
|
_name = 'exely.phones'
|
|
_description = 'Exely Phones'
|
|
_rec_name = 'phone'
|
|
|
|
phone = fields.Char(string="Phone")
|
|
|
|
|
|
class ExelyCustomer(models.Model):
|
|
_name = 'exely.customer'
|
|
_description = 'Exely 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="exely.email", string="Emails")
|
|
phones = fields.Many2many(comodel_name="exely.phones", string="Phones")
|
|
gender = fields.Char(string="Gender")
|
|
|
|
|
|
class ExelyRooms(models.Model):
|
|
_name = 'exely.rooms'
|
|
_description = 'Exely 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 ExelyGuests(models.Model):
|
|
_name = 'exely.guests'
|
|
_description = 'Exely 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="exely.email", string="Emails")
|
|
phones = fields.Many2many(comodel_name="exely.phones", string="Phones")
|
|
gender = fields.Char(string="Gender")
|
|
|
|
|
|
class ExelyAmenities(models.Model):
|
|
_name = 'exely.amenities'
|
|
_description = 'Exely Amenities'
|
|
_rec_name = 'name'
|
|
|
|
name = fields.Char(string="Name")
|
|
|
|
|
|
class ExelyRoomStays(models.Model):
|
|
_name = 'exely.roomstays'
|
|
_description = 'Exely 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="exely.rooms", string="Room ID")
|
|
roomTypeId = fields.Char(string="Room Type ID")
|
|
guestsIds = fields.Many2many(comodel_name="exely.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="exely.amenities", string="Amenities")
|
|
|
|
bookings_id = fields.Many2one(comodel_name="exely.bookings", string="Room Stay Id")
|
|
|
|
|
|
|
|
|
|
class ExcelyBookings(models.Model):
|
|
_name = 'exely.bookings'
|
|
_description = 'Exely 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="exely.customer", string="Customer")
|
|
roomStays = fields.One2many(comodel_name="exely.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")
|