Add models and views
This commit is contained in:
parent
fb9d32a2a3
commit
77b82e5538
2
.env
2
.env
@ -15,5 +15,5 @@ PASSWORD="odoo"
|
|||||||
ADDONS="--addons-path=/opt/odoo/addons/,/opt/odoo/customaddons/$CUSTOMADDONS_DIR"
|
ADDONS="--addons-path=/opt/odoo/addons/,/opt/odoo/customaddons/$CUSTOMADDONS_DIR"
|
||||||
ARGS=""
|
ARGS=""
|
||||||
# ARGS="-d bross"
|
# ARGS="-d bross"
|
||||||
ARGS="-d cybro_hms"
|
ARGS="-d cybro_hms -u bross_hms"
|
||||||
# DEBUG="-m debugpy --listen 0.0.0.0:5678 --wait-for-client"
|
# DEBUG="-m debugpy --listen 0.0.0.0:5678 --wait-for-client"
|
||||||
|
|||||||
50
bross.py
Normal file
50
bross.py
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import requests
|
||||||
|
import sys
|
||||||
|
|
||||||
|
headers = {
|
||||||
|
'X-API-KEY': 'b84f2c33-d9dc-439a-84ff-3deed4b18e10',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
}
|
||||||
|
#url = "https://connect.hopenapi.com/api/exelypms/v1/analytics/services"
|
||||||
|
#url = "https://connect.hopenapi.com/api/exelypms/v1/analytics/payments"
|
||||||
|
|
||||||
|
#payload = {'startDate': '20240909', 'endDate': '20240910', 'dateKind': 0, 'language': 'en'}
|
||||||
|
#response = requests.get(url, data=payload, headers=headers)
|
||||||
|
|
||||||
|
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/analytics/services?startDate=20241008&endDate=20241008&dateKind=4", headers=headers)
|
||||||
|
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/bookings/20240301-503875-1211582391", headers=headers)
|
||||||
|
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/bookings/20241217-503875-1220773707", headers=headers)
|
||||||
|
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/bookings/20240909-503875-1219004943", headers=headers)
|
||||||
|
|
||||||
|
response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/bookings?modifiedFrom=2024-01-01T00:00&modifiedTo=2024-01-30T23:59&state=Active", headers=headers)
|
||||||
|
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/bookings?modifiedFrom=2024-01-01T00:00&modifiedTo=2024-30-01T23:59&state=Cancelled", headers=headers)
|
||||||
|
|
||||||
|
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/rooms", headers=headers)
|
||||||
|
|
||||||
|
if response.status_code == 200:
|
||||||
|
data = response.json()
|
||||||
|
print(data)
|
||||||
|
|
||||||
|
sys.exit()
|
||||||
|
for i in data['data']['services']:
|
||||||
|
pass
|
||||||
|
#print(i)
|
||||||
|
for i in data['data']['customers']:
|
||||||
|
pass
|
||||||
|
#print(i)
|
||||||
|
for i in data['data']['agents']:
|
||||||
|
pass
|
||||||
|
#print(i)
|
||||||
|
for i in data['data']['reservations']:
|
||||||
|
#pass
|
||||||
|
print(i)
|
||||||
|
#if i['guestId'] == '9007199257013459_9007199256429978':
|
||||||
|
# print(i)
|
||||||
|
for i in data['data']['roomTypes']:
|
||||||
|
pass
|
||||||
|
#print(i)
|
||||||
|
else:
|
||||||
|
print(response.json())
|
||||||
|
print(f"Failed to retrieve data. Status code: {response.status_code}")
|
||||||
@ -1,30 +1,26 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
{
|
{
|
||||||
'name': "bross_hms",
|
'name': "bross_hms",
|
||||||
|
'summary': "HMS",
|
||||||
'summary': "Short (1 phrase/line) summary of the module's purpose",
|
'description': """Hotel Management System""",
|
||||||
|
'author': "Mate Managadze",
|
||||||
'description': """
|
'website': "https://www.brossegarden.com",
|
||||||
Long description of module's purpose
|
|
||||||
""",
|
|
||||||
|
|
||||||
'author': "My Company",
|
|
||||||
'website': "https://www.yourcompany.com",
|
|
||||||
|
|
||||||
# Categories can be used to filter modules in modules listing
|
|
||||||
# Check https://github.com/odoo/odoo/blob/15.0/odoo/addons/base/data/ir_module_category_data.xml
|
|
||||||
# for the full list
|
|
||||||
'category': 'Uncategorized',
|
'category': 'Uncategorized',
|
||||||
'version': '0.1',
|
'version': '17.0.1.0.0',
|
||||||
|
'license': 'OPL-1',
|
||||||
# any module necessary for this one to work correctly
|
|
||||||
'depends': ['base'],
|
'depends': ['base'],
|
||||||
|
|
||||||
# always loaded
|
|
||||||
'data': [
|
'data': [
|
||||||
# 'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
'views/views.xml',
|
'cron/crons.xml',
|
||||||
'views/templates.xml',
|
'views/main_menus.xml',
|
||||||
|
'views/emails.xml',
|
||||||
|
'views/phones.xml',
|
||||||
|
'views/customers.xml',
|
||||||
|
'views/guests.xml',
|
||||||
|
'views/amenities.xml',
|
||||||
|
'views/roomstays.xml',
|
||||||
|
'views/modified_bookings.xml',
|
||||||
|
'views/bookings.xml',
|
||||||
],
|
],
|
||||||
# only loaded in demonstration mode
|
# only loaded in demonstration mode
|
||||||
'demo': [
|
'demo': [
|
||||||
|
|||||||
17
bross_hms/cron/crons.xml
Normal file
17
bross_hms/cron/crons.xml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<odoo>
|
||||||
|
<data noupdate="1">
|
||||||
|
<record id="ir_cron_get_exely_data" model="ir.cron">
|
||||||
|
<field name="name">Get Exely Data</field>
|
||||||
|
<field name="model_id" ref="model_exely_bookings"/>
|
||||||
|
<field name="state">code</field>
|
||||||
|
<field name="code">model.get_exely_data()</field>
|
||||||
|
<field name="user_id" ref="base.user_root"/>
|
||||||
|
<field name="interval_number">1</field>
|
||||||
|
<field name="numbercall">-1</field>
|
||||||
|
<field name="doall" eval="True" />
|
||||||
|
<field name="active" eval="False"/>
|
||||||
|
<field name="priority">100</field>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
@ -1,30 +0,0 @@
|
|||||||
<odoo>
|
|
||||||
<data>
|
|
||||||
<!--
|
|
||||||
<record id="object0" model="bross_hms.bross_hms">
|
|
||||||
<field name="name">Object 0</field>
|
|
||||||
<field name="value">0</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="object1" model="bross_hms.bross_hms">
|
|
||||||
<field name="name">Object 1</field>
|
|
||||||
<field name="value">10</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="object2" model="bross_hms.bross_hms">
|
|
||||||
<field name="name">Object 2</field>
|
|
||||||
<field name="value">20</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="object3" model="bross_hms.bross_hms">
|
|
||||||
<field name="name">Object 3</field>
|
|
||||||
<field name="value">30</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="object4" model="bross_hms.bross_hms">
|
|
||||||
<field name="name">Object 4</field>
|
|
||||||
<field name="value">40</field>
|
|
||||||
</record>
|
|
||||||
-->
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@ -1,3 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from . import models
|
from . import exely_data
|
||||||
|
|||||||
296
bross_hms/models/exely_data.py
Normal file
296
bross_hms/models/exely_data.py
Normal file
@ -0,0 +1,296 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import requests
|
||||||
|
import logging
|
||||||
|
from odoo import models, fields, api, _
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
|
|
||||||
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
HEADERS = {
|
||||||
|
'X-API-KEY': 'b84f2c33-d9dc-439a-84ff-3deed4b18e10',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
}
|
||||||
|
|
||||||
|
STATES = ['Active', 'Cancelled']
|
||||||
|
|
||||||
|
|
||||||
|
class ExelyModifiedData(models.Model):
|
||||||
|
_name = 'exely.modified.bookings'
|
||||||
|
_description = 'Exely Modified Bookings'
|
||||||
|
_rec_name = 'booking_number'
|
||||||
|
|
||||||
|
mod_period_start = fields.Datetime(string="Start Date")
|
||||||
|
mod_period_end = fields.Datetime(string="End Date")
|
||||||
|
booking_number = fields.Char(string="Booking Number")
|
||||||
|
status = fields.Char(string="Status")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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 ExelyGuests(models.Model):
|
||||||
|
_name = 'exely.guests'
|
||||||
|
_description = 'Exely Guests'
|
||||||
|
_rec_name = 'bid'
|
||||||
|
|
||||||
|
bid = fields.Char(string="Guest ID", index=True)
|
||||||
|
|
||||||
|
|
||||||
|
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 ID", index=True)
|
||||||
|
bookingId = fields.Char(string="Booking ID", index=True)
|
||||||
|
roomId = fields.Char(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")
|
||||||
|
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")
|
||||||
|
sourceChannelName = fields.Char(string="Source Channel Name")
|
||||||
|
|
||||||
|
def json_data_store_visit(self):
|
||||||
|
self.visitPurpose = {
|
||||||
|
'id': self.id,
|
||||||
|
'key': self.number,
|
||||||
|
'value': self.number,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def generate_date_ranges(self, start_date, end_date):
|
||||||
|
date_ranges = []
|
||||||
|
current_date = start_date
|
||||||
|
|
||||||
|
while current_date < end_date:
|
||||||
|
period_start = current_date
|
||||||
|
period_end = min(current_date + timedelta(days=29), end_date)
|
||||||
|
|
||||||
|
if period_end.date() < end_date.date():
|
||||||
|
period_end = period_end.replace(hour=23, minute=59)
|
||||||
|
else:
|
||||||
|
period_end = end_date
|
||||||
|
|
||||||
|
date_ranges.append((
|
||||||
|
period_start.strftime("%Y-%m-%dT%H:%M"),
|
||||||
|
period_end.strftime("%Y-%m-%dT%H:%M")
|
||||||
|
))
|
||||||
|
|
||||||
|
current_date = period_end + timedelta(days=1)
|
||||||
|
return date_ranges
|
||||||
|
|
||||||
|
def get_exely_data(self):
|
||||||
|
start_date = datetime(2024, 1, 1)
|
||||||
|
end_date = datetime.now()
|
||||||
|
|
||||||
|
date_ranges = self.generate_date_ranges(start_date, end_date)
|
||||||
|
|
||||||
|
to_create = []
|
||||||
|
for status in STATES:
|
||||||
|
for start, end in date_ranges:
|
||||||
|
print(f"{start} to {end}")
|
||||||
|
|
||||||
|
url = f"https://connect.hopenapi.com/api/exelypms/v1/bookings?modifiedFrom={start}&modifiedTo={end}&state={status}"
|
||||||
|
# try:
|
||||||
|
response = requests.get(url, headers=HEADERS)
|
||||||
|
if response.status_code == 200:
|
||||||
|
data = response.json()
|
||||||
|
for booking_number in data['bookingNumbers']:
|
||||||
|
start_write = datetime.strptime(start, "%Y-%m-%dT%H:%M") - timedelta(hours=4)
|
||||||
|
end_write = datetime.strptime(end, "%Y-%m-%dT%H:%M") - timedelta(hours=4)
|
||||||
|
found_modified_booking = self.env['exely.modified.bookings'].search([
|
||||||
|
('mod_period_start', '=', start_write),
|
||||||
|
('mod_period_end', '=', end_write),
|
||||||
|
('booking_number', '=', booking_number),
|
||||||
|
('status', '=', status)]
|
||||||
|
)
|
||||||
|
if not found_modified_booking:
|
||||||
|
self.env['exely.modified.bookings'].create({
|
||||||
|
'mod_period_start': start_write,
|
||||||
|
'mod_period_end': end_write,
|
||||||
|
'booking_number': booking_number,
|
||||||
|
'status': status
|
||||||
|
})
|
||||||
|
|
||||||
|
url = f"https://connect.hopenapi.com/api/exelypms/v1/bookings/{booking_number}"
|
||||||
|
response = requests.get(url, headers=HEADERS)
|
||||||
|
if response.status_code == 200:
|
||||||
|
data = response.json()
|
||||||
|
|
||||||
|
data['bid'] = data.pop('id')
|
||||||
|
|
||||||
|
customer = data.pop('customer', None)
|
||||||
|
|
||||||
|
if customer:
|
||||||
|
customer['bid'] = customer.pop('id')
|
||||||
|
emails = customer.get('emails', None)
|
||||||
|
phones = customer.get('phones', None)
|
||||||
|
|
||||||
|
if emails:
|
||||||
|
email_ids = []
|
||||||
|
for email in emails:
|
||||||
|
found_email = self.env['exely.email'].search([('email', '=', email)])
|
||||||
|
if found_email:
|
||||||
|
email_id = found_email.id
|
||||||
|
else:
|
||||||
|
email_id = self.env['exely.email'].create({'email': email}).id
|
||||||
|
email_ids.append(email_id)
|
||||||
|
|
||||||
|
if email_ids:
|
||||||
|
customer['emails'] = [(6, 0, email_ids)]
|
||||||
|
|
||||||
|
if phones:
|
||||||
|
phone_ids = []
|
||||||
|
for phone in phones:
|
||||||
|
found_phone = self.env['exely.phones'].search([('phone', '=', phone)])
|
||||||
|
if found_phone:
|
||||||
|
phone_id = found_phone.id
|
||||||
|
else:
|
||||||
|
phone_id = self.env['exely.phones'].create({'phone': phone}).id
|
||||||
|
phone_ids.append(phone_id)
|
||||||
|
|
||||||
|
if phone_ids:
|
||||||
|
customer['phones'] = [(6, 0, phone_ids)]
|
||||||
|
|
||||||
|
found_customer = self.env['exely.customer'].search([('bid', '=', customer['bid'])])
|
||||||
|
if found_customer:
|
||||||
|
customer_id = found_customer.id
|
||||||
|
else:
|
||||||
|
customer_id = self.env['exely.customer'].create(customer).id
|
||||||
|
data['customer'] = customer_id
|
||||||
|
|
||||||
|
roomstays = data.pop('roomStays', None)
|
||||||
|
if roomstays:
|
||||||
|
roomstays_ids = []
|
||||||
|
for roomstay in roomstays:
|
||||||
|
roomstay['bid'] = roomstay.pop('id')
|
||||||
|
|
||||||
|
guests = roomstay.pop('guestsIds', None)
|
||||||
|
|
||||||
|
if guests:
|
||||||
|
guest_ids = []
|
||||||
|
for guest in guests:
|
||||||
|
found_guest = self.env['exely.guests'].search([('bid', '=', guest)])
|
||||||
|
if found_guest:
|
||||||
|
guest_id = found_guest.id
|
||||||
|
else:
|
||||||
|
guest_id = self.env['exely.guests'].create({'bid': guest}).id
|
||||||
|
guest_ids.append(guest_id)
|
||||||
|
|
||||||
|
if guest_ids:
|
||||||
|
roomstay['guestsIds'] = [(6, 0, guest_ids)]
|
||||||
|
|
||||||
|
amenities = roomstay.pop('amenities', None)
|
||||||
|
|
||||||
|
if not amenities:
|
||||||
|
amenity_ids = []
|
||||||
|
for amenity in amenities:
|
||||||
|
found_amenity = self.env['exely.amenities'].search([('name', '=', amenity)])
|
||||||
|
if found_amenity:
|
||||||
|
amenity_id = found_amenity.id
|
||||||
|
else:
|
||||||
|
amenity_id = self.env['exely.amenities'].create({'name': amenity}).id
|
||||||
|
amenity_ids.append(amenity_id)
|
||||||
|
|
||||||
|
if amenity_ids:
|
||||||
|
roomstay['amenities'] = [(6, 0, amenity_ids)]
|
||||||
|
|
||||||
|
found_roomstay = self.env['exely.roomstays'].search([('bid', '=', roomstay['bid'])])
|
||||||
|
if found_roomstay:
|
||||||
|
roomstay_id = found_roomstay.id
|
||||||
|
else:
|
||||||
|
roomstay_id = self.env['exely.roomstays'].create(roomstay).id
|
||||||
|
roomstays_ids.append(roomstay_id)
|
||||||
|
|
||||||
|
if roomstays_ids:
|
||||||
|
data['roomStays'] = [(6, 0, roomstays_ids)]
|
||||||
|
|
||||||
|
print(data)
|
||||||
|
to_create.append(data)
|
||||||
|
else:
|
||||||
|
_logger.warning(f"Failed to retrieve data. Status code: {response.status_code}")
|
||||||
|
# except Exception as e:
|
||||||
|
# _logger.warning(f"Error processing data: {e}")
|
||||||
|
|
||||||
|
if to_create:
|
||||||
|
for i in to_create:
|
||||||
|
try:
|
||||||
|
self.env['exely.bookings'].create(i)
|
||||||
|
except Exception as e:
|
||||||
|
_logger.warning(f"##############################: {i}")
|
||||||
|
break
|
||||||
|
# if to_create:
|
||||||
|
# self.env['exely.bookings'].create(to_create)
|
||||||
@ -1,19 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from odoo import models, fields, api
|
|
||||||
|
|
||||||
|
|
||||||
class bross_hms(models.Model):
|
|
||||||
_name = 'bross_hms.bross_hms'
|
|
||||||
_description = 'bross_hms.bross_hms'
|
|
||||||
|
|
||||||
name = fields.Char()
|
|
||||||
value = fields.Integer()
|
|
||||||
value2 = fields.Float(compute="_value_pc", store=True)
|
|
||||||
description = fields.Text()
|
|
||||||
|
|
||||||
@api.depends('value')
|
|
||||||
def _value_pc(self):
|
|
||||||
for record in self:
|
|
||||||
record.value2 = float(record.value) / 100
|
|
||||||
|
|
||||||
@ -1,2 +1,11 @@
|
|||||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||||
access_bross_hms_bross_hms,bross_hms.bross_hms,model_bross_hms_bross_hms,base.group_user,1,1,1,1
|
|
||||||
|
bross_hms.access_exely_modified_bookings,access_exely_modified_bookings,bross_hms.model_exely_modified_bookings,base.group_user,1,1,1,1
|
||||||
|
bross_hms.access_exely_bookings,access_exely_bookings,bross_hms.model_exely_bookings,base.group_user,1,1,1,1
|
||||||
|
|
||||||
|
bross_hms.access_exely_email,access_exely_email,bross_hms.model_exely_email,base.group_user,1,1,1,1
|
||||||
|
bross_hms.access_exely_phones,access_exely_phones,bross_hms.model_exely_phones,base.group_user,1,1,1,1
|
||||||
|
bross_hms.access_exely_customer,access_exely_customer,bross_hms.model_exely_customer,base.group_user,1,1,1,1
|
||||||
|
bross_hms.access_exely_guests,access_exely_guests,bross_hms.model_exely_guests,base.group_user,1,1,1,1
|
||||||
|
bross_hms.access_exely_amenities,access_exely_amenities,bross_hms.model_exely_amenities,base.group_user,1,1,1,1
|
||||||
|
bross_hms.access_exely_roomstays,access_exely_roomstays,bross_hms.model_exely_roomstays,base.group_user,1,1,1,1
|
||||||
|
27
bross_hms/views/amenities.xml
Normal file
27
bross_hms/views/amenities.xml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<record id="view_exely_amenities_tree" model="ir.ui.view">
|
||||||
|
<field name="name">exely.amenities.tree</field>
|
||||||
|
<field name="model">exely.amenities</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree>
|
||||||
|
<field name="name"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="action_exely_amenities_action" model="ir.actions.act_window">
|
||||||
|
<field name="name">Exely Amenities</field>
|
||||||
|
<field name="res_model">exely.amenities</field>
|
||||||
|
<field name="view_mode">tree</field>
|
||||||
|
<field name="help" type="html">
|
||||||
|
<p class="o_view_nocontent_smiling_face">
|
||||||
|
Create your first amenity record.
|
||||||
|
</p>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<menuitem id="menu_exely_amenities" name="Amenities" parent="exely_models_root_menu" sequence="50" action="action_exely_amenities_action"/>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
65
bross_hms/views/bookings.xml
Normal file
65
bross_hms/views/bookings.xml
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<record id="view_exely_bookings_tree" model="ir.ui.view">
|
||||||
|
<field name="name">exely.bookings.tree</field>
|
||||||
|
<field name="model">exely.bookings</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree>
|
||||||
|
<field name="bid"/>
|
||||||
|
<field name="number"/>
|
||||||
|
<field name="customerLanguage"/>
|
||||||
|
<field name="lastModified"/>
|
||||||
|
<field name="currencyId"/>
|
||||||
|
<field name="sourceChannelName"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_exely_bookings_form" model="ir.ui.view">
|
||||||
|
<field name="name">exely.bookings.form</field>
|
||||||
|
<field name="model">exely.bookings</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form edit="0">
|
||||||
|
<header>
|
||||||
|
|
||||||
|
</header>
|
||||||
|
<sheet>
|
||||||
|
<group class="oe_title">
|
||||||
|
<h1><field name="bid"/></h1>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<field name="number"/>
|
||||||
|
<field name="customerLanguage"/>
|
||||||
|
<field name="visitPurpose"/>
|
||||||
|
<!-- <button name="json_data_store_visit" type="object" class="btn btn-primary" string="Visit Purpose"/> -->
|
||||||
|
<field name="customerComment"/>
|
||||||
|
<field name="lastModified"/>
|
||||||
|
<field name="currencyId"/>
|
||||||
|
<field name="customer"/>
|
||||||
|
<field name="customerCompany"/>
|
||||||
|
<field name="source"/>
|
||||||
|
<field name="sourceChannelName"/>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<field name="roomStays" widget="many2many_tags"/>
|
||||||
|
</group>
|
||||||
|
</sheet>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="action_exely_bookings_action" model="ir.actions.act_window">
|
||||||
|
<field name="name">Exely Bookings</field>
|
||||||
|
<field name="res_model">exely.bookings</field>
|
||||||
|
<field name="view_mode">tree,form</field>
|
||||||
|
<field name="help" type="html">
|
||||||
|
<p class="o_view_nocontent_smiling_face">
|
||||||
|
Create your first booking record.
|
||||||
|
</p>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<menuitem name="Exely Bookings" parent="exely_root_menu" id="exely_bookings_root_menu" sequence="20" action="action_exely_bookings_action"/>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
78
bross_hms/views/customers.xml
Normal file
78
bross_hms/views/customers.xml
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<record id="view_exely_customer_tree" model="ir.ui.view">
|
||||||
|
<field name="name">exely.customer.tree</field>
|
||||||
|
<field name="model">exely.customer</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree>
|
||||||
|
<field name="bid"/>
|
||||||
|
<field name="lastName"/>
|
||||||
|
<field name="firstName"/>
|
||||||
|
<field name="middleName"/>
|
||||||
|
<field name="birthDate"/>
|
||||||
|
<field name="citizenshipCode"/>
|
||||||
|
<field name="gender"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_exely_customer_form" model="ir.ui.view">
|
||||||
|
<field name="name">exely.customer.form</field>
|
||||||
|
<field name="model">exely.customer</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form edit="0">
|
||||||
|
<header>
|
||||||
|
|
||||||
|
</header>
|
||||||
|
<sheet>
|
||||||
|
<group class="oe_title">
|
||||||
|
<h1><field name="bid"/></h1>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<group>
|
||||||
|
<field name="firstName"/>
|
||||||
|
<field name="lastName"/>
|
||||||
|
<field name="middleName"/>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<field name="birthDate"/>
|
||||||
|
<field name="citizenshipCode"/>
|
||||||
|
<field name="gender"/>
|
||||||
|
<field name="status"/>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<field name="emails" widget="many2many_tags"/>
|
||||||
|
<field name="phones" widget="many2many_tags"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
</sheet>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- <record id="view_exely_customer_graph" model="ir.ui.view">
|
||||||
|
<field name="name">exely.customer.graph</field>
|
||||||
|
<field name="model">exely.customer</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<graph string="Customers" type="line" sample="1">
|
||||||
|
<field name="citizenshipCode"/>
|
||||||
|
<field name="gender" type="measure"/>
|
||||||
|
</graph>
|
||||||
|
</field>
|
||||||
|
</record> -->
|
||||||
|
|
||||||
|
<record id="action_exely_customer_action" model="ir.actions.act_window">
|
||||||
|
<field name="name">Exely Customers</field>
|
||||||
|
<field name="res_model">exely.customer</field>
|
||||||
|
<field name="view_mode">tree,form,pivot,graph</field>
|
||||||
|
<field name="help" type="html">
|
||||||
|
<p class="o_view_nocontent_smiling_face">
|
||||||
|
Create your first customer record.
|
||||||
|
</p>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<menuitem id="menu_exely_customer" name="Customers" parent="exely_models_root_menu" sequence="30" action="action_exely_customer_action"/>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
27
bross_hms/views/emails.xml
Normal file
27
bross_hms/views/emails.xml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<record id="view_exely_email_tree" model="ir.ui.view">
|
||||||
|
<field name="name">exely.email.tree</field>
|
||||||
|
<field name="model">exely.email</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree>
|
||||||
|
<field name="email"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="action_exely_email_action" model="ir.actions.act_window">
|
||||||
|
<field name="name">Exely Emails</field>
|
||||||
|
<field name="res_model">exely.email</field>
|
||||||
|
<field name="view_mode">tree</field>
|
||||||
|
<field name="help" type="html">
|
||||||
|
<p class="o_view_nocontent_smiling_face">
|
||||||
|
Create your first email record.
|
||||||
|
</p>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<menuitem id="menu_exely_email" name="Emails" parent="exely_models_root_menu" sequence="10" action="action_exely_email_action"/>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
27
bross_hms/views/guests.xml
Normal file
27
bross_hms/views/guests.xml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<record id="view_exely_guests_tree" model="ir.ui.view">
|
||||||
|
<field name="name">exely.guests.tree</field>
|
||||||
|
<field name="model">exely.guests</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree>
|
||||||
|
<field name="bid"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="action_exely_guests_action" model="ir.actions.act_window">
|
||||||
|
<field name="name">Exely Guests</field>
|
||||||
|
<field name="res_model">exely.guests</field>
|
||||||
|
<field name="view_mode">tree</field>
|
||||||
|
<field name="help" type="html">
|
||||||
|
<p class="o_view_nocontent_smiling_face">
|
||||||
|
Create your first guest record.
|
||||||
|
</p>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<menuitem id="menu_exely_guests" name="Guests" parent="exely_models_root_menu" sequence="40" action="action_exely_guests_action"/>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
7
bross_hms/views/main_menus.xml
Normal file
7
bross_hms/views/main_menus.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<menuitem name="Exely Data" id="exely_root_menu" sequence="10"/>
|
||||||
|
|
||||||
|
<menuitem name="Exely Models" parent="exely_root_menu" id="exely_models_root_menu" sequence="30"/>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
32
bross_hms/views/modified_bookings.xml
Normal file
32
bross_hms/views/modified_bookings.xml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<record model="ir.ui.view" id="exely_modified_bookings_view_list">
|
||||||
|
<field name="name">exely.modified.bookings.tree</field>
|
||||||
|
<field name="model">exely.modified.bookings</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree>
|
||||||
|
<field name="mod_period_start"/>
|
||||||
|
<field name="mod_period_end"/>
|
||||||
|
<field name="booking_number"/>
|
||||||
|
<field name="status"/>
|
||||||
|
<field name="create_date"/>
|
||||||
|
<field name="write_date"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.actions.act_window" id="exely_modified_bookings_action">
|
||||||
|
<field name="name">exely.modified.data</field>
|
||||||
|
<field name="res_model">exely.modified.bookings</field>
|
||||||
|
<field name="view_mode">tree</field>
|
||||||
|
<field name="help" type="html">
|
||||||
|
<p class="o_view_nocontent_smiling_face">
|
||||||
|
Create your first modified bookings record.
|
||||||
|
</p>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<menuitem name="Modified Bookings" id="exely_modified_bookings_submenu" parent="exely_root_menu" action="exely_modified_bookings_action" sequence="10"/>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
27
bross_hms/views/phones.xml
Normal file
27
bross_hms/views/phones.xml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<record id="view_exely_phones_tree" model="ir.ui.view">
|
||||||
|
<field name="name">exely.phones.tree</field>
|
||||||
|
<field name="model">exely.phones</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree>
|
||||||
|
<field name="phone"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="action_exely_phones_action" model="ir.actions.act_window">
|
||||||
|
<field name="name">Exely Phones</field>
|
||||||
|
<field name="res_model">exely.phones</field>
|
||||||
|
<field name="view_mode">tree</field>
|
||||||
|
<field name="help" type="html">
|
||||||
|
<p class="o_view_nocontent_smiling_face">
|
||||||
|
Create your first phone record.
|
||||||
|
</p>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<menuitem id="menu_exely_phones" name="Phones" parent="exely_models_root_menu" sequence="20" action="action_exely_phones_action"/>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
34
bross_hms/views/roomstays.xml
Normal file
34
bross_hms/views/roomstays.xml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<record id="view_exely_roomstays_tree" model="ir.ui.view">
|
||||||
|
<field name="name">exely.roomstays.tree</field>
|
||||||
|
<field name="model">exely.roomstays</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree>
|
||||||
|
<field name="bid"/>
|
||||||
|
<field name="bookingId"/>
|
||||||
|
<field name="roomId"/>
|
||||||
|
<field name="roomTypeId"/>
|
||||||
|
<field name="checkInDateTime"/>
|
||||||
|
<field name="checkOutDateTime"/>
|
||||||
|
<field name="status"/>
|
||||||
|
<field name="bookingStatus"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="action_exely_roomstays_action" model="ir.actions.act_window">
|
||||||
|
<field name="name">Exely Room Stays</field>
|
||||||
|
<field name="res_model">exely.roomstays</field>
|
||||||
|
<field name="view_mode">tree</field>
|
||||||
|
<field name="help" type="html">
|
||||||
|
<p class="o_view_nocontent_smiling_face">
|
||||||
|
Create your first room stay record.
|
||||||
|
</p>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<menuitem id="menu_exely_roomstays" name="Room Stays" parent="exely_models_root_menu" sequence="60" action="action_exely_roomstays_action"/>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
@ -1,24 +0,0 @@
|
|||||||
<odoo>
|
|
||||||
<data>
|
|
||||||
<!--
|
|
||||||
<template id="listing">
|
|
||||||
<ul>
|
|
||||||
<li t-foreach="objects" t-as="object">
|
|
||||||
<a t-attf-href="#{ root }/objects/#{ object.id }">
|
|
||||||
<t t-esc="object.display_name"/>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</template>
|
|
||||||
<template id="object">
|
|
||||||
<h1><t t-esc="object.display_name"/></h1>
|
|
||||||
<dl>
|
|
||||||
<t t-foreach="object._fields" t-as="field">
|
|
||||||
<dt><t t-esc="field"/></dt>
|
|
||||||
<dd><t t-esc="object[field]"/></dd>
|
|
||||||
</t>
|
|
||||||
</dl>
|
|
||||||
</template>
|
|
||||||
-->
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@ -1,60 +0,0 @@
|
|||||||
<odoo>
|
|
||||||
<data>
|
|
||||||
<!-- explicit list view definition -->
|
|
||||||
<!--
|
|
||||||
<record model="ir.ui.view" id="bross_hms.list">
|
|
||||||
<field name="name">bross_hms list</field>
|
|
||||||
<field name="model">bross_hms.bross_hms</field>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<tree>
|
|
||||||
<field name="name"/>
|
|
||||||
<field name="value"/>
|
|
||||||
<field name="value2"/>
|
|
||||||
</tree>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- actions opening views on models -->
|
|
||||||
<!--
|
|
||||||
<record model="ir.actions.act_window" id="bross_hms.action_window">
|
|
||||||
<field name="name">bross_hms window</field>
|
|
||||||
<field name="res_model">bross_hms.bross_hms</field>
|
|
||||||
<field name="view_mode">tree,form</field>
|
|
||||||
</record>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- server action to the one above -->
|
|
||||||
<!--
|
|
||||||
<record model="ir.actions.server" id="bross_hms.action_server">
|
|
||||||
<field name="name">bross_hms server</field>
|
|
||||||
<field name="model_id" ref="model_bross_hms_bross_hms"/>
|
|
||||||
<field name="state">code</field>
|
|
||||||
<field name="code">
|
|
||||||
action = {
|
|
||||||
"type": "ir.actions.act_window",
|
|
||||||
"view_mode": "tree,form",
|
|
||||||
"res_model": model._name,
|
|
||||||
}
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- Top menu item -->
|
|
||||||
<!--
|
|
||||||
<menuitem name="bross_hms" id="bross_hms.menu_root"/>
|
|
||||||
-->
|
|
||||||
<!-- menu categories -->
|
|
||||||
<!--
|
|
||||||
<menuitem name="Menu 1" id="bross_hms.menu_1" parent="bross_hms.menu_root"/>
|
|
||||||
<menuitem name="Menu 2" id="bross_hms.menu_2" parent="bross_hms.menu_root"/>
|
|
||||||
-->
|
|
||||||
<!-- actions -->
|
|
||||||
<!--
|
|
||||||
<menuitem name="List" id="bross_hms.menu_1_list" parent="bross_hms.menu_1"
|
|
||||||
action="bross_hms.action_window"/>
|
|
||||||
<menuitem name="Server to list" id="bross_hms" parent="bross_hms.menu_2"
|
|
||||||
action="bross_hms.action_server"/>
|
|
||||||
-->
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
Loading…
Reference in New Issue
Block a user