Compare commits
No commits in common. "92b2f180f58099ec86428818693059330441f634" and "d4e0bf734fe4b3982a70ebebe31acb6ba01ae96e" have entirely different histories.
92b2f180f5
...
d4e0bf734f
2
bross.py
2
bross.py
@ -45,7 +45,7 @@ headers = {
|
|||||||
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/guests/9007199255607320/room-stays", headers=headers)
|
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/guests/9007199255607320/room-stays", headers=headers)
|
||||||
|
|
||||||
# ALL ROOMS
|
# ALL ROOMS
|
||||||
response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/rooms", headers=headers)
|
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/rooms", headers=headers)
|
||||||
|
|
||||||
|
|
||||||
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/rooms?roomTypeId=5020078", headers=headers)
|
# response = requests.get("https://connect.hopenapi.com/api/exelypms/v1/rooms?roomTypeId=5020078", headers=headers)
|
||||||
|
|||||||
@ -18,8 +18,6 @@
|
|||||||
'views/bank_account_views.xml',
|
'views/bank_account_views.xml',
|
||||||
'views/bank_settings_views.xml',
|
'views/bank_settings_views.xml',
|
||||||
'views/raw_movements.xml',
|
'views/raw_movements.xml',
|
||||||
'views/bank_deposits_views.xml',
|
|
||||||
'views/service_payments_views.xml',
|
|
||||||
],
|
],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'application': True,
|
'application': True,
|
||||||
|
|||||||
@ -11,16 +11,5 @@
|
|||||||
<field name="active" eval="False"/>
|
<field name="active" eval="False"/>
|
||||||
<field name="priority">100</field>
|
<field name="priority">100</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="ir_cron_process_movements_data" model="ir.cron">
|
|
||||||
<field name="name">Process Movements Data</field>
|
|
||||||
<field name="model_id" ref="model_bank_raw_movements"/>
|
|
||||||
<field name="state">code</field>
|
|
||||||
<field name="code">model.process_movements()</field>
|
|
||||||
<field name="user_id" ref="base.user_root"/>
|
|
||||||
<field name="interval_number">1</field>
|
|
||||||
<field name="active" eval="False"/>
|
|
||||||
<field name="priority">100</field>
|
|
||||||
</record>
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
@ -2,5 +2,3 @@ from . import bank
|
|||||||
from . import bank_account
|
from . import bank_account
|
||||||
from . import bank_settings
|
from . import bank_settings
|
||||||
from . import bank_models
|
from . import bank_models
|
||||||
from . import bank_deposits
|
|
||||||
from . import service_payments
|
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
from odoo import models, fields, _
|
from odoo import models, fields
|
||||||
|
|
||||||
|
|
||||||
class BrosseBankAccount(models.Model):
|
class BrosseBankAccount(models.Model):
|
||||||
_name = 'brosse.bank.account'
|
_name = 'brosse.bank.account'
|
||||||
_description = 'Bank Account'
|
_description = 'Bank Account'
|
||||||
_rec_name = 'account_number'
|
|
||||||
|
|
||||||
account_number = fields.Char(string='Account Number', required=True)
|
account_number = fields.Char(string='Account Number', required=True)
|
||||||
holder_name = fields.Char(string='Holder Name')
|
holder_name = fields.Char(string='Holder Name')
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
from odoo import models, fields, _
|
|
||||||
|
|
||||||
|
|
||||||
class BrosseBankDeposits(models.Model):
|
|
||||||
_name = 'brosse.bank.deposits'
|
|
||||||
_description = 'Bank Deposits'
|
|
||||||
|
|
||||||
amount = fields.Monetary(string="Amount", currency_field='currency_id')
|
|
||||||
currency_id = fields.Many2one('res.currency', string='Account Currency')
|
|
||||||
|
|
||||||
bank_account_id = fields.Many2one('brosse.bank.account', string="Bank Account")
|
|
||||||
@ -2,36 +2,12 @@ import base64
|
|||||||
import tempfile
|
import tempfile
|
||||||
import hashlib
|
import hashlib
|
||||||
import json
|
import json
|
||||||
import math
|
|
||||||
import os
|
import os
|
||||||
from odoo import models, fields, _
|
from odoo import models, fields, _
|
||||||
from tbc_bank_integration_service_lib.client import TBCBankClient
|
from tbc_bank_integration_service_lib.client import TBCBankClient
|
||||||
from odoo.exceptions import UserError
|
from odoo.exceptions import UserError
|
||||||
|
|
||||||
|
|
||||||
BANKS = {
|
|
||||||
"NB": {"name": "National Bank of Georgia", "code": "BNLNGE22"},
|
|
||||||
"TR": {"name": "State Treasury", "code": "TRESGE22"},
|
|
||||||
"BG": {"name": 'JSC "Bank of Georgia"', "code": "BAGAGE22"},
|
|
||||||
"BS": {"name": 'JSC "BasisBank"', "code": "CBASGE22"},
|
|
||||||
"BT": {"name": 'JSC "Silk Bank"', "code": "DISNGE22"},
|
|
||||||
"CR": {"name": 'JSC "Cartu Bank"', "code": "CRTUGE22"},
|
|
||||||
"HB": {"name": 'JSC "Halyk Bank Georgia"', "code": "HABGGE22"},
|
|
||||||
"KS": {"name": 'JSC "Terabank"', "code": "TEBAGE22"},
|
|
||||||
"LB": {"name": 'JSC "Liberty Bank"', "code": "LBRTGE22"},
|
|
||||||
"PC": {"name": 'JSC "ProCredit Bank"', "code": "MIBGGE22"},
|
|
||||||
"TB": {"name": 'JSC "TBC Bank"', "code": "TBCBGE22"},
|
|
||||||
"VT": {"name": 'JSC "VTB Bank Georgia "', "code": "UGEBGE22"},
|
|
||||||
"ZB": {"name": 'JSC "Ziraat Bank Georgia"', "code": "TCZBGE22"},
|
|
||||||
"PB": {"name": 'JSC “Pasha Bank Georgia”', "code": "PAHAGE22"},
|
|
||||||
"IS": {"name": 'JSC "Isbank Georgia"', "code": "ISBKGE22"},
|
|
||||||
"CD": {"name": 'JSC "Credo Bank"', "code": "JSCRGE22"},
|
|
||||||
"PS": {"name": 'JSC "Paysera Bank Georgia"', "code": "PSRAGE22"},
|
|
||||||
"HS": {"name": 'JSC "HASH Bank"', "code": "HAJSGE22"},
|
|
||||||
"PV": {"name": 'JSC "Pave Bank Georgia"', "code": "PAVEGE22"},
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class BankMovements(models.Model):
|
class BankMovements(models.Model):
|
||||||
_name = 'bank.raw.movements'
|
_name = 'bank.raw.movements'
|
||||||
_description = 'Bank Movements'
|
_description = 'Bank Movements'
|
||||||
@ -70,62 +46,12 @@ class BankMovements(models.Model):
|
|||||||
'json_hash_code': hash_hex,
|
'json_hash_code': hash_hex,
|
||||||
'bid': bid
|
'bid': bid
|
||||||
})
|
})
|
||||||
|
|
||||||
def get_movements(self):
|
def get_movements(self):
|
||||||
client = self.env['bank.settings'].get_request_object()
|
client = self.env['bank.settings'].get_request_object()
|
||||||
res = client.get_account_movements_by_date_range('111111', '2024-01-01T00:00:00.000', '2024-10-01T00:00:00.000')
|
try:
|
||||||
self.create_or_update_raw_data(res, 'bank.raw.movements', res['data'])
|
movement_id = '013762510743.2'
|
||||||
pages = math.ceil(int(res['data']['pager']['totalcount']) / int(res['data']['pager']['pagesize']))
|
movements_by_id = client.get_account_movements_by_id('111111', movement_id)
|
||||||
if pages > 1:
|
self.create_or_update_raw_data(movements_by_id, 'bank.raw.movements', movements_by_id['data'].get('movementId'))
|
||||||
for page in range(1, pages):
|
except Exception as e:
|
||||||
res = client.get_account_movements_by_date_range_next_page('111111', page, 700, '2024-01-01T00:00:00.000', '2024-10-01T00:00:00.000')
|
_logger.error(e)
|
||||||
self.create_or_update_raw_data(res, 'bank.raw.movements', res['data'])
|
|
||||||
|
|
||||||
def process_movements(self):
|
|
||||||
to_process_movements = self.env['bank.raw.movements'].search([])
|
|
||||||
for info in to_process_movements:
|
|
||||||
data = json.loads(info.json_data)
|
|
||||||
|
|
||||||
for movement in data['data']['movements']:
|
|
||||||
account_number = movement['accountNumber']
|
|
||||||
account_name = movement['accountName']
|
|
||||||
amount = movement['amount']['amount']
|
|
||||||
currency = movement['amount']['currency']
|
|
||||||
iban_code = account_number[4:6]
|
|
||||||
|
|
||||||
found_bank = self.env['brosse.bank'].search([('iban_code', '=', iban_code)])
|
|
||||||
|
|
||||||
if found_bank:
|
|
||||||
bank_id = found_bank.id
|
|
||||||
else:
|
|
||||||
bank_id = self.env['brosse.bank'].create({
|
|
||||||
'name': BANKS[iban_code]['name'],
|
|
||||||
'bank_code': BANKS[iban_code]['code'],
|
|
||||||
'iban_code': iban_code
|
|
||||||
}).id
|
|
||||||
|
|
||||||
found_bank_account = self.env['brosse.bank.account'].search([('account_number', '=', account_number)])
|
|
||||||
|
|
||||||
if found_bank_account:
|
|
||||||
bank_account_id = found_bank_account.id
|
|
||||||
else:
|
|
||||||
bank_account_id = self.env['brosse.bank.account'].create({
|
|
||||||
'bank_ids': [(4, bank_id)],
|
|
||||||
'holder_name': account_name,
|
|
||||||
'account_number': account_number,
|
|
||||||
}).id
|
|
||||||
|
|
||||||
self.env['brosse.bank.deposits'].create({
|
|
||||||
'bank_account_id': bank_account_id,
|
|
||||||
'amount': amount,
|
|
||||||
'currency_id': self.env['res.currency'].search([('name', '=', currency)]).id
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# movement_id = '013762510743.2'
|
|
||||||
# movements_by_id = client.get_account_movements_by_id('111111', movement_id)
|
|
||||||
# self.create_or_update_raw_data(movements_by_id, 'bank.raw.movements', movements_by_id['data'].get('movementId'))
|
|
||||||
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
from odoo import models, fields, _
|
|
||||||
|
|
||||||
|
|
||||||
class BrosseServicePayments(models.Model):
|
|
||||||
_name = 'brosse.service.payments'
|
|
||||||
_description = 'Service Payments'
|
|
||||||
|
|
||||||
amount = fields.Monetary(string="Amount", currency_field='currency_id')
|
|
||||||
currency_id = fields.Many2one('res.currency', string='Account Currency')
|
|
||||||
@ -2,6 +2,4 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
|||||||
access_brosse_bank_user,access_brosse_bank,model_brosse_bank,base.group_user,1,1,1,1
|
access_brosse_bank_user,access_brosse_bank,model_brosse_bank,base.group_user,1,1,1,1
|
||||||
access_brosse_bank_account_user,access_brosse_bank_account,model_brosse_bank_account,base.group_user,1,1,1,1
|
access_brosse_bank_account_user,access_brosse_bank_account,model_brosse_bank_account,base.group_user,1,1,1,1
|
||||||
access_bank_settings_admin,access_bank_settings,model_bank_settings,base.group_system,1,1,1,1
|
access_bank_settings_admin,access_bank_settings,model_bank_settings,base.group_system,1,1,1,1
|
||||||
bross_bank_management.access_bank_raw_movements,access_bank_raw_movements,bross_bank_management.model_bank_raw_movements,base.group_user,1,1,1,1
|
bross_bank_management.access_bank_raw_movements,access_bank_raw_movements,bross_bank_management.model_bank_raw_movements,base.group_user,1,1,1,1
|
||||||
bross_bank_management.access_brosse_bank_deposits,access_brosse_bank_deposits,bross_bank_management.model_brosse_bank_deposits,base.group_user,1,1,1,1
|
|
||||||
bross_bank_management.access_brosse_service_payments,access_brosse_service_payments,bross_bank_management.model_brosse_service_payments,base.group_user,1,1,1,1
|
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
<odoo>
|
|
||||||
<data>
|
|
||||||
<record id="view_brosse_bank_deposits_tree" model="ir.ui.view">
|
|
||||||
<field name="name">Deposits</field>
|
|
||||||
<field name="model">brosse.bank.deposits</field>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<list string="Bank Deposits" editable="bottom">
|
|
||||||
<field name="bank_account_id"/>
|
|
||||||
<field name="amount"/>
|
|
||||||
<field name="currency_id" invisible='1'/>
|
|
||||||
</list>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="action_brosse_bank_deposits" model="ir.actions.act_window">
|
|
||||||
<field name="name">Bank Deposits</field>
|
|
||||||
<field name="res_model">brosse.bank.deposits</field>
|
|
||||||
<field name="view_mode">list</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<menuitem id="menu_brosse_bank_deposits_root"
|
|
||||||
name="Bank Deposits"
|
|
||||||
parent="bross_hms.finance_root_menu"
|
|
||||||
action="action_brosse_bank_deposits"
|
|
||||||
sequence="10"/>
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<menuitem name="Bank Management" id="bank_management_submenu" parent="bross_hms.property_management_root_menu" sequence="10"/>
|
<menuitem name="Bank Management" id="bank_management_submenu" parent="bross_hms.exely_root_menu" sequence="40"/>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
@ -1,26 +0,0 @@
|
|||||||
<odoo>
|
|
||||||
<data>
|
|
||||||
<record id="view_brosse_service_payments_list" model="ir.ui.view">
|
|
||||||
<field name="name">Service Payments</field>
|
|
||||||
<field name="model">brosse.service.payments</field>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<list string="Bank Deposits" editable="bottom">
|
|
||||||
<field name="amount"/>
|
|
||||||
<field name="currency_id" invisible='1'/>
|
|
||||||
</list>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="action_brosse_service_payments" model="ir.actions.act_window">
|
|
||||||
<field name="name">Service Payments</field>
|
|
||||||
<field name="res_model">brosse.service.payments</field>
|
|
||||||
<field name="view_mode">list</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<menuitem id="menu_service_payments_root"
|
|
||||||
name="Service Payments"
|
|
||||||
parent="bross_hms.finance_root_menu"
|
|
||||||
action="action_brosse_service_payments"
|
|
||||||
sequence="20"/>
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@ -12,27 +12,17 @@
|
|||||||
'data': [
|
'data': [
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
# 'cron/crons.xml',
|
# 'cron/crons.xml',
|
||||||
'data/service_kinds.xml',
|
|
||||||
'views/misc_menus.xml',
|
'views/misc_menus.xml',
|
||||||
'views/main_menus.xml',
|
'views/main_menus.xml',
|
||||||
'views/emails.xml',
|
'views/emails.xml',
|
||||||
'views/phones.xml',
|
'views/phones.xml',
|
||||||
'views/customers.xml',
|
'views/customers.xml',
|
||||||
'views/rooms.xml',
|
'views/rooms.xml',
|
||||||
'views/room_types.xml',
|
|
||||||
'views/floor.xml',
|
|
||||||
'views/services.xml',
|
|
||||||
'views/guests.xml',
|
'views/guests.xml',
|
||||||
'views/amenities.xml',
|
'views/amenities.xml',
|
||||||
'views/roomstays.xml',
|
'views/roomstays.xml',
|
||||||
'views/agents.xml',
|
|
||||||
'views/bookings.xml',
|
'views/bookings.xml',
|
||||||
'views/status.xml',
|
|
||||||
],
|
],
|
||||||
'assets': {
|
# only loaded in demonstration mode
|
||||||
'web.assets_backend': [
|
|
||||||
'bross_hms/static/src/scss/required.scss',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,62 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<odoo>
|
|
||||||
<data noupdate="1">
|
|
||||||
<record id="service_kind_0" model="hms.service.kinds">
|
|
||||||
<field name="name">accommodation</field>
|
|
||||||
<field name="hms_id">0</field>
|
|
||||||
</record>
|
|
||||||
<record id="service_kind_1" model="hms.service.kinds">
|
|
||||||
<field name="name">extra service</field>
|
|
||||||
<field name="hms_id">1</field>
|
|
||||||
</record>
|
|
||||||
<record id="service_kind_2" model="hms.service.kinds">
|
|
||||||
<field name="name">transfer</field>
|
|
||||||
<field name="hms_id">2</field>
|
|
||||||
</record>
|
|
||||||
<record id="service_kind_3" model="hms.service.kinds">
|
|
||||||
<field name="name">early check-in</field>
|
|
||||||
<field name="hms_id">3</field>
|
|
||||||
</record>
|
|
||||||
<record id="service_kind_4" model="hms.service.kinds">
|
|
||||||
<field name="name">late check-out</field>
|
|
||||||
<field name="hms_id">4</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="service_vat_kind_0" model="hms.service.vat.kinds">
|
|
||||||
<field name="name">not subject to VAT</field>
|
|
||||||
<field name="hms_id">0</field>
|
|
||||||
</record>
|
|
||||||
<record id="service_vat_kind_1" model="hms.service.vat.kinds">
|
|
||||||
<field name="name">subject to 0% VAT</field>
|
|
||||||
<field name="hms_id">1</field>
|
|
||||||
</record>
|
|
||||||
<record id="service_vat_kind_2" model="hms.service.vat.kinds">
|
|
||||||
<field name="name">subject to 10% VAT</field>
|
|
||||||
<field name="hms_id">2</field>
|
|
||||||
</record>
|
|
||||||
<record id="service_vat_kind_3" model="hms.service.vat.kinds">
|
|
||||||
<field name="name">subject to 18% VAT</field>
|
|
||||||
<field name="hms_id">3</field>
|
|
||||||
</record>
|
|
||||||
<record id="service_vat_kind_4" model="hms.service.vat.kinds">
|
|
||||||
<field name="name">subject to 10/110 VAT</field>
|
|
||||||
<field name="hms_id">4</field>
|
|
||||||
</record>
|
|
||||||
<record id="service_vat_kind_5" model="hms.service.vat.kinds">
|
|
||||||
<field name="name">subject to 18/118 VAT</field>
|
|
||||||
<field name="hms_id">5</field>
|
|
||||||
</record>
|
|
||||||
<record id="service_vat_kind_6" model="hms.service.vat.kinds">
|
|
||||||
<field name="name">subject to 20/120 VAT</field>
|
|
||||||
<field name="hms_id">6</field>
|
|
||||||
</record>
|
|
||||||
<record id="service_vat_kind_7" model="hms.service.vat.kinds">
|
|
||||||
<field name="name">subject to 20% VAT</field>
|
|
||||||
<field name="hms_id">7</field>
|
|
||||||
</record>
|
|
||||||
<record id="service_vat_kind_8" model="hms.service.vat.kinds">
|
|
||||||
<field name="name">subject to 12% VAT</field>
|
|
||||||
<field name="hms_id">8</field>
|
|
||||||
</record>
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@ -1,3 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from . import hms_models
|
from . import exely_data
|
||||||
|
|||||||
125
bross_hms/models/exely_data.py
Normal file
125
bross_hms/models/exely_data.py
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
# -*- 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")
|
||||||
@ -1,216 +0,0 @@
|
|||||||
# -*- 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.Many2one(comodel_name="hms.room.types", string="Room Type")
|
|
||||||
floorId = fields.Many2one(comodel_name="hms.floors", string="Floor")
|
|
||||||
|
|
||||||
|
|
||||||
class HmsRoomTypes(models.Model):
|
|
||||||
_name = 'hms.room.types'
|
|
||||||
_description = 'Hms Room Types'
|
|
||||||
_rec_name = 'name'
|
|
||||||
|
|
||||||
bid = fields.Char(string="Room Type ID", index=True)
|
|
||||||
name = fields.Char(string="Name")
|
|
||||||
|
|
||||||
|
|
||||||
class HmsFloors(models.Model):
|
|
||||||
_name = 'hms.floors'
|
|
||||||
_description = 'Hms Floors'
|
|
||||||
_rec_name = 'name'
|
|
||||||
|
|
||||||
bid = fields.Char(string="Floor ID", index=True)
|
|
||||||
name = fields.Char(string="Name")
|
|
||||||
|
|
||||||
|
|
||||||
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.Many2one(comodel_name="hms.room.types", 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.Many2one(comodel_name="hms.status", string="Status")
|
|
||||||
bookingStatus = fields.Many2one(comodel_name="hms.booking.status", 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 HmsSourceChannel(models.Model):
|
|
||||||
_name = 'hms.source.channel'
|
|
||||||
_description = 'Hms Source Channel'
|
|
||||||
_rec_name = 'name'
|
|
||||||
|
|
||||||
name = fields.Char(string="Name")
|
|
||||||
|
|
||||||
|
|
||||||
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.Many2one(comodel_name="hms.source.channel", 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)
|
|
||||||
|
|
||||||
|
|
||||||
class HmsAgents(models.Model):
|
|
||||||
_name = 'hms.agents'
|
|
||||||
_description = 'Hms Agents'
|
|
||||||
_rec_name = 'name'
|
|
||||||
|
|
||||||
index = fields.Integer(string="Index")
|
|
||||||
bid = fields.Char(string="Agent ID", index=True)
|
|
||||||
name = fields.Char(string="Name")
|
|
||||||
inn = fields.Char(string="Tax ID")
|
|
||||||
kpp = fields.Char(string="Tax Registration Reason Code")
|
|
||||||
phone = fields.Many2one(comodel_name="hms.phones", string="Phone")
|
|
||||||
email = fields.Many2one(comodel_name="hms.email", string="Email")
|
|
||||||
legalAddress = fields.Char(string="Registered Address")
|
|
||||||
mailingAddress = fields.Char(string="Postal Address")
|
|
||||||
|
|
||||||
|
|
||||||
class HmsServiceKinds(models.Model):
|
|
||||||
_name = 'hms.service.kinds'
|
|
||||||
_description = 'Hms Service Kinds'
|
|
||||||
_rec_name = 'name'
|
|
||||||
|
|
||||||
name = fields.Char(string="Name")
|
|
||||||
hms_id = fields.Integer(string="ID")
|
|
||||||
|
|
||||||
|
|
||||||
class HmsServiceVatKinds(models.Model):
|
|
||||||
_name = 'hms.service.vat.kinds'
|
|
||||||
_description = 'Hms Service Vat Kinds'
|
|
||||||
_rec_name = 'name'
|
|
||||||
|
|
||||||
name = fields.Char(string="Name")
|
|
||||||
hms_id = fields.Integer(string="ID")
|
|
||||||
|
|
||||||
|
|
||||||
class HmsServices(models.Model):
|
|
||||||
_name = 'hms.services'
|
|
||||||
_description = 'Hms Services'
|
|
||||||
_rec_name = 'bid'
|
|
||||||
|
|
||||||
bid = fields.Char(string="ID")
|
|
||||||
kind = fields.Many2one(comodel_name="hms.service.kinds", string="Kind")
|
|
||||||
name = fields.Char(string="Name")
|
|
||||||
amount = fields.Float(string="Amount")
|
|
||||||
discount = fields.Float(string="Discount")
|
|
||||||
vat_kind = fields.Many2one(comodel_name="hms.service.vat.kinds", string="VAT Kind")
|
|
||||||
vat = fields.Float(string="VAT")
|
|
||||||
quantity = fields.Integer(string="Quantity")
|
|
||||||
service_date = fields.Datetime(string="Date")
|
|
||||||
reservationId = fields.Char(string="Reservation")
|
|
||||||
optionCategory = fields.Char(string="Option Category")
|
|
||||||
isIncluded = fields.Boolean(string="Is Included")
|
|
||||||
@ -1,21 +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
|
||||||
|
|
||||||
bross_hms.access_hms_bookings,access_hms_bookings,bross_hms.model_hms_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_hms_email,access_hms_email,bross_hms.model_hms_email,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_hms_phones,access_hms_phones,bross_hms.model_hms_phones,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_hms_customer,access_hms_customer,bross_hms.model_hms_customer,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_hms_rooms,access_hms_rooms,bross_hms.model_hms_rooms,base.group_user,1,1,1,1
|
bross_hms.access_exely_rooms,access_exely_rooms,bross_hms.model_exely_rooms,base.group_user,1,1,1,1
|
||||||
bross_hms.access_hms_room_types,access_hms_room_types,bross_hms.model_hms_room_types,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_hms_floors,access_hms_floors,bross_hms.model_hms_floors,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_hms_guests,access_hms_guests,bross_hms.model_hms_guests,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
|
||||||
bross_hms.access_hms_amenities,access_hms_amenities,bross_hms.model_hms_amenities,base.group_user,1,1,1,1
|
|
||||||
bross_hms.access_hms_roomstays,access_hms_roomstays,bross_hms.model_hms_roomstays,base.group_user,1,1,1,1
|
|
||||||
bross_hms.access_hms_source_channel,access_hms_source_channel,bross_hms.model_hms_source_channel,base.group_user,1,1,1,1
|
|
||||||
bross_hms.access_hms_agents,access_hms_agents,bross_hms.model_hms_agents,base.group_user,1,1,1,1
|
|
||||||
bross_hms.access_hms_status,access_hms_status,bross_hms.model_hms_status,base.group_user,1,1,1,1
|
|
||||||
bross_hms.access_hms_booking_status,access_hms_booking_status,bross_hms.model_hms_booking_status,base.group_user,1,1,1,1
|
|
||||||
|
|
||||||
bross_hms.access_hms_service_kinds,access_hms_service_kinds,bross_hms.model_hms_service_kinds,base.group_user,1,1,1,1
|
|
||||||
bross_hms.access_hms_service_vat_kinds,access_hms_service_vat_kinds,bross_hms.model_hms_service_vat_kinds,base.group_user,1,1,1,1
|
|
||||||
bross_hms.access_hms_services,access_hms_services,bross_hms.model_hms_services,base.group_user,1,1,1,1
|
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
.o_required_modifier {
|
|
||||||
&.o_input, .o_input {
|
|
||||||
background-color: #D2D2FF!important;
|
|
||||||
border-top-left-radius: 5px;
|
|
||||||
border-top-right-radius: 5px;
|
|
||||||
border-bottom-left-radius: 5px;
|
|
||||||
border-bottom-right-radius: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.o_input {
|
|
||||||
border:$input-border-width solid var(--o-input-border-color);
|
|
||||||
border-width: 100 100 $input-border-width 0;
|
|
||||||
padding: $o-input-padding-y $o-input-padding-x;
|
|
||||||
background-color: var(--o-input-background-color, #{$input-bg});
|
|
||||||
|
|
||||||
// -- Nested o_input(s)
|
|
||||||
.o_input {
|
|
||||||
border: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.o_list_renderer .o_data_row.o_selected_row > .o_data_cell.o_required_modifier:not(.o_readonly_modifier) {
|
|
||||||
background-color: #D2D2FF!important
|
|
||||||
}
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<odoo>
|
|
||||||
<data>
|
|
||||||
<record id="view_hms_agents_tree" model="ir.ui.view">
|
|
||||||
<field name="name">Agents</field>
|
|
||||||
<field name="model">hms.agents</field>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<list>
|
|
||||||
<field name="name"/>
|
|
||||||
</list>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="action_hms_agents_action" model="ir.actions.act_window">
|
|
||||||
<field name="name">Agents</field>
|
|
||||||
<field name="res_model">hms.agents</field>
|
|
||||||
<field name="view_mode">list</field>
|
|
||||||
<field name="help" type="html">
|
|
||||||
<p class="o_view_nocontent_smiling_face">
|
|
||||||
Create your first amenity record.
|
|
||||||
</p>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<menuitem id="menu_hms_agents" name="Agents" parent="customers_and_partners_root_menu" sequence="50" action="action_hms_agents_action"/>
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<record id="view_hms_amenities_tree" model="ir.ui.view">
|
<record id="view_exely_amenities_tree" model="ir.ui.view">
|
||||||
<field name="name">Amenities</field>
|
<field name="name">exely.amenities.tree</field>
|
||||||
<field name="model">hms.amenities</field>
|
<field name="model">exely.amenities</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<list>
|
<list>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
@ -11,9 +11,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_hms_amenities_action" model="ir.actions.act_window">
|
<record id="action_exely_amenities_action" model="ir.actions.act_window">
|
||||||
<field name="name">Amenities</field>
|
<field name="name">Exely Amenities</field>
|
||||||
<field name="res_model">hms.amenities</field>
|
<field name="res_model">exely.amenities</field>
|
||||||
<field name="view_mode">list</field>
|
<field name="view_mode">list</field>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="o_view_nocontent_smiling_face">
|
<p class="o_view_nocontent_smiling_face">
|
||||||
@ -22,6 +22,6 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<menuitem id="menu_hms_amenities" name="Amenities" parent="property_management_root_menu" sequence="60" action="action_hms_amenities_action"/>
|
<menuitem id="menu_exely_amenities" name="Amenities" parent="exely_models_root_menu" sequence="60" action="action_exely_amenities_action"/>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<record id="view_hms_bookings_tree" model="ir.ui.view">
|
<record id="view_exely_bookings_tree" model="ir.ui.view">
|
||||||
<field name="name">Reception</field>
|
<field name="name">exely.bookings.tree</field>
|
||||||
<field name="model">hms.bookings</field>
|
<field name="model">exely.bookings</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<list>
|
<list>
|
||||||
<field name="bid"/>
|
<field name="bid"/>
|
||||||
@ -16,9 +16,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="view_hms_bookings_form" model="ir.ui.view">
|
<record id="view_exely_bookings_form" model="ir.ui.view">
|
||||||
<field name="name">Reception</field>
|
<field name="name">exely.bookings.form</field>
|
||||||
<field name="model">hms.bookings</field>
|
<field name="model">exely.bookings</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form edit="0">
|
<form edit="0">
|
||||||
<header>
|
<header>
|
||||||
@ -50,9 +50,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_hms_bookings_action" model="ir.actions.act_window">
|
<record id="action_exely_bookings_action" model="ir.actions.act_window">
|
||||||
<field name="name">Reception</field>
|
<field name="name">Exely Bookings</field>
|
||||||
<field name="res_model">hms.bookings</field>
|
<field name="res_model">exely.bookings</field>
|
||||||
<field name="view_mode">list,form</field>
|
<field name="view_mode">list,form</field>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="o_view_nocontent_smiling_face">
|
<p class="o_view_nocontent_smiling_face">
|
||||||
@ -61,6 +61,6 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<menuitem name="Reception" parent="hms_root_menu" id="reception_root_menu" sequence="10" action="action_hms_bookings_action"/>
|
<menuitem name="Bookings" parent="exely_root_menu" id="exely_bookings_root_menu" sequence="20" action="action_exely_bookings_action"/>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<record id="view_hms_customer_tree" model="ir.ui.view">
|
<record id="view_exely_customer_tree" model="ir.ui.view">
|
||||||
<field name="name">Customer</field>
|
<field name="name">exely.customer.tree</field>
|
||||||
<field name="model">hms.customer</field>
|
<field name="model">exely.customer</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<list>
|
<list>
|
||||||
<field name="bid"/>
|
<field name="bid"/>
|
||||||
@ -17,9 +17,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="view_hms_customer_form" model="ir.ui.view">
|
<record id="view_exely_customer_form" model="ir.ui.view">
|
||||||
<field name="name">Customer</field>
|
<field name="name">exely.customer.form</field>
|
||||||
<field name="model">hms.customer</field>
|
<field name="model">exely.customer</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form edit="0">
|
<form edit="0">
|
||||||
<header>
|
<header>
|
||||||
@ -51,9 +51,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- <record id="view_hms_customer_graph" model="ir.ui.view">
|
<!-- <record id="view_exely_customer_graph" model="ir.ui.view">
|
||||||
<field name="name">Customer</field>
|
<field name="name">exely.customer.graph</field>
|
||||||
<field name="model">hms.customer</field>
|
<field name="model">exely.customer</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<graph string="Customers" type="line" sample="1">
|
<graph string="Customers" type="line" sample="1">
|
||||||
<field name="citizenshipCode"/>
|
<field name="citizenshipCode"/>
|
||||||
@ -62,9 +62,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record> -->
|
</record> -->
|
||||||
|
|
||||||
<record id="action_hms_customer_action" model="ir.actions.act_window">
|
<record id="action_exely_customer_action" model="ir.actions.act_window">
|
||||||
<field name="name">Customer</field>
|
<field name="name">Exely Customers</field>
|
||||||
<field name="res_model">hms.customer</field>
|
<field name="res_model">exely.customer</field>
|
||||||
<field name="view_mode">list,form,pivot,graph</field>
|
<field name="view_mode">list,form,pivot,graph</field>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="o_view_nocontent_smiling_face">
|
<p class="o_view_nocontent_smiling_face">
|
||||||
@ -73,6 +73,6 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<menuitem id="menu_hms_customer" name="Customers" parent="customers_and_partners_root_menu" sequence="30" action="action_hms_customer_action"/>
|
<menuitem id="menu_exely_customer" name="Customers" parent="exely_models_root_menu" sequence="30" action="action_exely_customer_action"/>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<record id="view_hms_email_tree" model="ir.ui.view">
|
<record id="view_exely_email_tree" model="ir.ui.view">
|
||||||
<field name="name">Email</field>
|
<field name="name">exely.email.tree</field>
|
||||||
<field name="model">hms.email</field>
|
<field name="model">exely.email</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<list>
|
<list>
|
||||||
<field name="email"/>
|
<field name="email"/>
|
||||||
@ -11,9 +11,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_hms_email_action" model="ir.actions.act_window">
|
<record id="action_exely_email_action" model="ir.actions.act_window">
|
||||||
<field name="name">Email</field>
|
<field name="name">Exely Emails</field>
|
||||||
<field name="res_model">hms.email</field>
|
<field name="res_model">exely.email</field>
|
||||||
<field name="view_mode">list</field>
|
<field name="view_mode">list</field>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="o_view_nocontent_smiling_face">
|
<p class="o_view_nocontent_smiling_face">
|
||||||
@ -22,6 +22,6 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<menuitem id="menu_hms_email" name="Emails" parent="customers_and_partners_root_menu" groups="base.group_no_one" sequence="10" action="action_hms_email_action"/>
|
<menuitem id="menu_exely_email" name="Emails" parent="exely_models_root_menu" sequence="10" action="action_exely_email_action"/>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@ -1,28 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<odoo>
|
|
||||||
<data>
|
|
||||||
<record id="view_hms_floors_tree" model="ir.ui.view">
|
|
||||||
<field name="name">Floor</field>
|
|
||||||
<field name="model">hms.floors</field>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<list>
|
|
||||||
<field name="bid"/>
|
|
||||||
<field name="name"/>
|
|
||||||
</list>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="action_hms_floors_action" model="ir.actions.act_window">
|
|
||||||
<field name="name">Floor</field>
|
|
||||||
<field name="res_model">hms.floors</field>
|
|
||||||
<field name="view_mode">list</field>
|
|
||||||
<field name="help" type="html">
|
|
||||||
<p class="o_view_nocontent_smiling_face">
|
|
||||||
Create your first floor record.
|
|
||||||
</p>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<menuitem id="menu_hms_floors" name="Floor" parent="property_management_root_menu" sequence="40" action="action_hms_floors_action"/>
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<record id="view_hms_guests_tree" model="ir.ui.view">
|
<record id="view_exely_guests_tree" model="ir.ui.view">
|
||||||
<field name="name">Guest</field>
|
<field name="name">exely.guests.tree</field>
|
||||||
<field name="model">hms.guests</field>
|
<field name="model">exely.guests</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<list>
|
<list>
|
||||||
<field name="bid"/>
|
<field name="bid"/>
|
||||||
@ -20,9 +20,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="view_hms_guests_form" model="ir.ui.view">
|
<record id="view_exely_guests_form" model="ir.ui.view">
|
||||||
<field name="name">Guest</field>
|
<field name="name">exely.guests.form</field>
|
||||||
<field name="model">hms.guests</field>
|
<field name="model">exely.guests</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form edit="0">
|
<form edit="0">
|
||||||
<header>
|
<header>
|
||||||
@ -52,9 +52,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_hms_guests_action" model="ir.actions.act_window">
|
<record id="action_exely_guests_action" model="ir.actions.act_window">
|
||||||
<field name="name">Guest</field>
|
<field name="name">Exely Guests</field>
|
||||||
<field name="res_model">hms.guests</field>
|
<field name="res_model">exely.guests</field>
|
||||||
<field name="view_mode">list,form</field>
|
<field name="view_mode">list,form</field>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="o_view_nocontent_smiling_face">
|
<p class="o_view_nocontent_smiling_face">
|
||||||
@ -63,6 +63,6 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<menuitem id="menu_hms_guests" name="Guests" parent="customers_and_partners_root_menu" sequence="50" action="action_hms_guests_action"/>
|
<menuitem id="menu_exely_guests" name="Guests" parent="exely_models_root_menu" sequence="50" action="action_exely_guests_action"/>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@ -1,13 +1,7 @@
|
|||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<menuitem name="HMS" id="hms_root_menu" sequence="10"/>
|
<menuitem name="HMS" id="exely_root_menu" sequence="10"/>
|
||||||
|
|
||||||
<menuitem name="Customers & Partners" parent="hms_root_menu" id="customers_and_partners_root_menu" sequence="20"/>
|
<menuitem name="HMS Models" parent="exely_root_menu" id="exely_models_root_menu" sequence="30"/>
|
||||||
|
|
||||||
<menuitem name="Finance" parent="hms_root_menu" id="finance_root_menu" sequence="30"/>
|
|
||||||
|
|
||||||
<menuitem name="Property management" parent="hms_root_menu" id="property_management_root_menu" sequence="40"/>
|
|
||||||
|
|
||||||
<menuitem name="Finance" parent="hms_root_menu" id="finance_root_menu" sequence="50"/>
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<record id="view_hms_phones_tree" model="ir.ui.view">
|
<record id="view_exely_phones_tree" model="ir.ui.view">
|
||||||
<field name="name">Phone</field>
|
<field name="name">exely.phones.tree</field>
|
||||||
<field name="model">hms.phones</field>
|
<field name="model">exely.phones</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<list>
|
<list>
|
||||||
<field name="phone"/>
|
<field name="phone"/>
|
||||||
@ -11,9 +11,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_hms_phones_action" model="ir.actions.act_window">
|
<record id="action_exely_phones_action" model="ir.actions.act_window">
|
||||||
<field name="name">Phone</field>
|
<field name="name">Exely Phones</field>
|
||||||
<field name="res_model">hms.phones</field>
|
<field name="res_model">exely.phones</field>
|
||||||
<field name="view_mode">list</field>
|
<field name="view_mode">list</field>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="o_view_nocontent_smiling_face">
|
<p class="o_view_nocontent_smiling_face">
|
||||||
@ -22,6 +22,6 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<menuitem id="menu_hms_phones" name="Phones" parent="customers_and_partners_root_menu" groups="base.group_no_one" sequence="20" action="action_hms_phones_action"/>
|
<menuitem id="menu_exely_phones" name="Phones" parent="exely_models_root_menu" sequence="20" action="action_exely_phones_action"/>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@ -1,28 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<odoo>
|
|
||||||
<data>
|
|
||||||
<record id="view_hms_room_types_tree" model="ir.ui.view">
|
|
||||||
<field name="name">Room Types</field>
|
|
||||||
<field name="model">hms.room.types</field>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<list>
|
|
||||||
<field name="bid"/>
|
|
||||||
<field name="name"/>
|
|
||||||
</list>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="action_hms_room_types_action" model="ir.actions.act_window">
|
|
||||||
<field name="name">Room Types</field>
|
|
||||||
<field name="res_model">hms.room.types</field>
|
|
||||||
<field name="view_mode">list</field>
|
|
||||||
<field name="help" type="html">
|
|
||||||
<p class="o_view_nocontent_smiling_face">
|
|
||||||
Create your first room type record.
|
|
||||||
</p>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<menuitem id="menu_hms_room_types" name="Room Types" parent="property_management_root_menu" sequence="30" action="action_hms_room_types_action"/>
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<record id="view_hms_rooms_tree" model="ir.ui.view">
|
<record id="view_exely_rooms_tree" model="ir.ui.view">
|
||||||
<field name="name">Room</field>
|
<field name="name">exely.rooms.tree</field>
|
||||||
<field name="model">hms.rooms</field>
|
<field name="model">exely.rooms</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<list>
|
<list>
|
||||||
<field name="bid"/>
|
<field name="bid"/>
|
||||||
@ -14,9 +14,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_hms_rooms_action" model="ir.actions.act_window">
|
<record id="action_exely_rooms_action" model="ir.actions.act_window">
|
||||||
<field name="name">Room</field>
|
<field name="name">Exely Rooms</field>
|
||||||
<field name="res_model">hms.rooms</field>
|
<field name="res_model">exely.rooms</field>
|
||||||
<field name="view_mode">list</field>
|
<field name="view_mode">list</field>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="o_view_nocontent_smiling_face">
|
<p class="o_view_nocontent_smiling_face">
|
||||||
@ -25,6 +25,6 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<menuitem id="menu_hms_rooms" name="Rooms" parent="property_management_root_menu" sequence="20" action="action_hms_rooms_action"/>
|
<menuitem id="menu_exely_rooms" name="Rooms" parent="exely_models_root_menu" sequence="40" action="action_exely_rooms_action"/>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<record id="view_hms_roomstays_tree" model="ir.ui.view">
|
<record id="view_exely_roomstays_tree" model="ir.ui.view">
|
||||||
<field name="name">Roomstays</field>
|
<field name="name">exely.roomstays.tree</field>
|
||||||
<field name="model">hms.roomstays</field>
|
<field name="model">exely.roomstays</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<list>
|
<list>
|
||||||
<field name="bid"/>
|
<field name="bid"/>
|
||||||
@ -18,9 +18,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="view_hms_roomstays_form" model="ir.ui.view">
|
<record id="view_exely_roomstays_form" model="ir.ui.view">
|
||||||
<field name="name">Roomstays</field>
|
<field name="name">exely.roomstays.form</field>
|
||||||
<field name="model">hms.roomstays</field>
|
<field name="model">exely.roomstays</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form edit="0">
|
<form edit="0">
|
||||||
<header>
|
<header>
|
||||||
@ -46,9 +46,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_hms_roomstays_action" model="ir.actions.act_window">
|
<record id="action_exely_roomstays_action" model="ir.actions.act_window">
|
||||||
<field name="name">RoomStays</field>
|
<field name="name">Exely Room Stays</field>
|
||||||
<field name="res_model">hms.roomstays</field>
|
<field name="res_model">exely.roomstays</field>
|
||||||
<field name="view_mode">list,form</field>
|
<field name="view_mode">list,form</field>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="o_view_nocontent_smiling_face">
|
<p class="o_view_nocontent_smiling_face">
|
||||||
@ -57,6 +57,6 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<menuitem id="menu_hms_roomstays" name="Room Stays" parent="customers_and_partners_root_menu" groups="base.group_no_one" sequence="40" action="action_hms_roomstays_action"/>
|
<menuitem id="menu_exely_roomstays" name="Room Stays" parent="exely_models_root_menu" sequence="70" action="action_exely_roomstays_action"/>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@ -1,28 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<odoo>
|
|
||||||
<data>
|
|
||||||
<record id="view_hms_services_tree" model="ir.ui.view">
|
|
||||||
<field name="name">Floor</field>
|
|
||||||
<field name="model">hms.services</field>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<list>
|
|
||||||
<field name="bid"/>
|
|
||||||
<field name="name"/>
|
|
||||||
</list>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="action_hms_services_action" model="ir.actions.act_window">
|
|
||||||
<field name="name">Floor</field>
|
|
||||||
<field name="res_model">hms.services</field>
|
|
||||||
<field name="view_mode">list</field>
|
|
||||||
<field name="help" type="html">
|
|
||||||
<p class="o_view_nocontent_smiling_face">
|
|
||||||
Create your first service record.
|
|
||||||
</p>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<menuitem id="menu_hms_services" name="Services" parent="property_management_root_menu" sequence="50" action="action_hms_services_action"/>
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@ -1,52 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<odoo>
|
|
||||||
<data>
|
|
||||||
<record id="view_hms_status_tree" model="ir.ui.view">
|
|
||||||
<field name="name">Status</field>
|
|
||||||
<field name="model">hms.status</field>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<list>
|
|
||||||
<field name="name"/>
|
|
||||||
</list>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="action_hms_status_action" model="ir.actions.act_window">
|
|
||||||
<field name="name">Status</field>
|
|
||||||
<field name="res_model">hms.status</field>
|
|
||||||
<field name="view_mode">list</field>
|
|
||||||
<field name="help" type="html">
|
|
||||||
<p class="o_view_nocontent_smiling_face">
|
|
||||||
Create your first status record.
|
|
||||||
</p>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<menuitem id="menu_hms_status" name="Status" parent="property_management_root_menu" sequence="70" action="action_hms_status_action"/>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<record id="view_hms_booking_status_tree" model="ir.ui.view">
|
|
||||||
<field name="name">Booking Status</field>
|
|
||||||
<field name="model">hms.booking.status</field>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<list>
|
|
||||||
<field name="name"/>
|
|
||||||
</list>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="action_hms_booking_status_action" model="ir.actions.act_window">
|
|
||||||
<field name="name">Booking Status</field>
|
|
||||||
<field name="res_model">hms.booking.status</field>
|
|
||||||
<field name="view_mode">list</field>
|
|
||||||
<field name="help" type="html">
|
|
||||||
<p class="o_view_nocontent_smiling_face">
|
|
||||||
Create your first booking status record.
|
|
||||||
</p>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<menuitem id="menu_hms_booking_status" name="Booking Status" parent="property_management_root_menu" sequence="80" action="action_hms_booking_status_action"/>
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@ -20,8 +20,8 @@ services:
|
|||||||
- 5678:5678
|
- 5678:5678
|
||||||
# - 8069:8069
|
# - 8069:8069
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/nvme_disk/docker_data/code_server/config/workspace/odoo18/:/opt/odoo/
|
- /opt/nvme_disk/docker_data/code_server/code_projects/odoo18/:/opt/odoo/
|
||||||
- /opt/nvme_disk/docker_data/code_server/config/workspace/odoo18/customaddons/${CUSTOMADDONS_DIR}/odoo.conf:/etc/odoo.conf
|
- /opt/nvme_disk/docker_data/code_server/code_projects/odoo18/customaddons/${CUSTOMADDONS_DIR}/odoo.conf:/etc/odoo.conf
|
||||||
- /opt/nvme_disk/docker_data/code_server/code_projects_data/odoo18_odoo_filestore:/root/.local/share/Odoo/
|
- /opt/nvme_disk/docker_data/code_server/code_projects_data/odoo18_odoo_filestore:/root/.local/share/Odoo/
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
@ -37,7 +37,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/nvme_disk/docker_data/code_server/config/workspace/odoo18/customaddons/${CUSTOMADDONS_DIR}/nginx.conf:/etc/nginx/conf.d/default.conf
|
- /opt/nvme_disk/docker_data/code_server/code_projects/odoo18/customaddons/${CUSTOMADDONS_DIR}/nginx.conf:/etc/nginx/conf.d/default.conf
|
||||||
depends_on:
|
depends_on:
|
||||||
- odoo
|
- odoo
|
||||||
|
|
||||||
|
|||||||
@ -33,16 +33,5 @@
|
|||||||
<field name="active" eval="False"/>
|
<field name="active" eval="False"/>
|
||||||
<field name="priority">100</field>
|
<field name="priority">100</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="ir_cron_process_exely_payments" model="ir.cron">
|
|
||||||
<field name="name">Process Exely Payments</field>
|
|
||||||
<field name="model_id" ref="model_exely_modified_bookings"/>
|
|
||||||
<field name="state">code</field>
|
|
||||||
<field name="code">model.process_exely_payments()</field>
|
|
||||||
<field name="user_id" ref="base.user_root"/>
|
|
||||||
<field name="interval_number">1</field>
|
|
||||||
<field name="active" eval="False"/>
|
|
||||||
<field name="priority">100</field>
|
|
||||||
</record>
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
@ -190,68 +190,6 @@ class ExelyModifiedData(models.Model):
|
|||||||
if payments:
|
if payments:
|
||||||
self.create_or_update_raw_data(payments, 'exely.raw.payments', f"{start}{end}")
|
self.create_or_update_raw_data(payments, 'exely.raw.payments', f"{start}{end}")
|
||||||
|
|
||||||
def process_exely_payments(self):
|
|
||||||
found_payment_record = self.env['hms.bookings'].search([], order="write_date desc", limit=1)
|
|
||||||
if False:
|
|
||||||
max_date = found_payment_record.write_date
|
|
||||||
else:
|
|
||||||
max_date = datetime.strptime('1970-01-01', "%Y-%m-%d").date()
|
|
||||||
|
|
||||||
to_process_payments = self.env['exely.raw.payments'].search([('write_date', '>', max_date), ('parent_id', '=', False)])
|
|
||||||
|
|
||||||
to_create = []
|
|
||||||
for payment in to_process_payments:
|
|
||||||
data = json.loads(payment.json_data)
|
|
||||||
|
|
||||||
payment_data = data.pop('data', None)
|
|
||||||
|
|
||||||
if payment_data:
|
|
||||||
all_agents = payment_data.pop('agents', None)
|
|
||||||
if all_agents:
|
|
||||||
for agent in all_agents:
|
|
||||||
agent['bid'] = agent.pop('id')
|
|
||||||
|
|
||||||
email = agent.get('email', None)
|
|
||||||
if email:
|
|
||||||
agent['email'] = self.env['hms.email'].search([('email', '=', email)], limit=1).id or self.env['hms.email'].create({'email': email}).id
|
|
||||||
phone = agent.get('phone', None)
|
|
||||||
if phone:
|
|
||||||
agent['phone'] = self.env['hms.phones'].search([('phone', '=', phone)], limit=1).id or self.env['hms.phones'].create({'phone': phone}).id
|
|
||||||
|
|
||||||
if all_agents:
|
|
||||||
for agent in all_agents:
|
|
||||||
found_agent = self.env['hms.agents'].search([('bid', '=', agent['bid'])])
|
|
||||||
if not found_agent:
|
|
||||||
self.env['hms.agents'].create(agent)
|
|
||||||
|
|
||||||
all_roomtypes = payment_data.pop('roomTypes', None)
|
|
||||||
if all_roomtypes:
|
|
||||||
for roomtype in all_roomtypes:
|
|
||||||
roomtype['bid'] = roomtype.pop('id')
|
|
||||||
found_roomtype = self.env['hms.room.types'].search([('bid', '=', roomtype['bid'])])
|
|
||||||
if not found_roomtype:
|
|
||||||
self.env['hms.room.types'].create(roomtype)
|
|
||||||
else:
|
|
||||||
found_roomtype.write(roomtype)
|
|
||||||
|
|
||||||
all_services = payment_data.pop('services', None)
|
|
||||||
if all_services:
|
|
||||||
for service in all_services:
|
|
||||||
service['bid'] = service.pop('id')
|
|
||||||
|
|
||||||
kind = service.pop('kind', None)
|
|
||||||
if kind:
|
|
||||||
service['kind'] = self.env['hms.service.kinds'].search([('hms_id', '=', kind)]).id
|
|
||||||
|
|
||||||
vat_kind = service.pop('vatKind', None)
|
|
||||||
if vat_kind:
|
|
||||||
service['vat_kind'] = self.env['hms.service.vat.kinds'].search([('hms_id', '=', vat_kind)]).id
|
|
||||||
|
|
||||||
service['service_date'] = datetime.strptime(service.pop('date', None), "%Y%m%d").strftime("%Y-%m-%d")
|
|
||||||
|
|
||||||
found_service = self.env['hms.services'].search([('bid', '=', service['bid'])])
|
|
||||||
if not found_service:
|
|
||||||
self.env['hms.services'].create(service)
|
|
||||||
|
|
||||||
def get_exely_data(self):
|
def get_exely_data(self):
|
||||||
exely_api_conf = self.env['exely.api.conf'].search([], limit=1)
|
exely_api_conf = self.env['exely.api.conf'].search([], limit=1)
|
||||||
@ -319,9 +257,10 @@ class ExelyModifiedData(models.Model):
|
|||||||
guest = self.get_exely_data_api(f"https://connect.hopenapi.com/api/exelypms/v1/guests/{bid}", headers)
|
guest = self.get_exely_data_api(f"https://connect.hopenapi.com/api/exelypms/v1/guests/{bid}", headers)
|
||||||
|
|
||||||
self.create_or_update_raw_data(guest, 'exely.raw.guests', bid)
|
self.create_or_update_raw_data(guest, 'exely.raw.guests', bid)
|
||||||
|
## break
|
||||||
|
|
||||||
def process_exely_data(self):
|
def process_exely_data(self):
|
||||||
found_booking_record = self.env['hms.bookings'].search([], order="write_date desc", limit=1)
|
found_booking_record = self.env['exely.bookings'].search([], order="write_date desc", limit=1)
|
||||||
if found_booking_record:
|
if found_booking_record:
|
||||||
max_date = found_booking_record.write_date
|
max_date = found_booking_record.write_date
|
||||||
else:
|
else:
|
||||||
@ -340,22 +279,22 @@ class ExelyModifiedData(models.Model):
|
|||||||
customer['bid'] = customer.pop('id')
|
customer['bid'] = customer.pop('id')
|
||||||
if customer.get('emails', None):
|
if customer.get('emails', None):
|
||||||
customer['emails'] = [(6, 0, [
|
customer['emails'] = [(6, 0, [
|
||||||
self.env['hms.email'].search([('email', '=', email)], limit=1).id or
|
self.env['exely.email'].search([('email', '=', email)], limit=1).id or
|
||||||
self.env['hms.email'].create({'email': email}).id
|
self.env['exely.email'].create({'email': email}).id
|
||||||
for email in customer['emails']
|
for email in customer['emails']
|
||||||
])]
|
])]
|
||||||
if customer.get('phones', None):
|
if customer.get('phones', None):
|
||||||
customer['phones'] = [(6, 0, [
|
customer['phones'] = [(6, 0, [
|
||||||
self.env['hms.phones'].search([('phone', '=', phone)], limit=1).id or
|
self.env['exely.phones'].search([('phone', '=', phone)], limit=1).id or
|
||||||
self.env['hms.phones'].create({'phone': phone}).id
|
self.env['exely.phones'].create({'phone': phone}).id
|
||||||
for phone in customer['phones']
|
for phone in customer['phones']
|
||||||
])]
|
])]
|
||||||
|
|
||||||
found_customer = self.env['hms.customer'].search([('bid', '=', customer['bid'])])
|
found_customer = self.env['exely.customer'].search([('bid', '=', customer['bid'])])
|
||||||
if found_customer:
|
if found_customer:
|
||||||
customer_id = found_customer.id
|
customer_id = found_customer.id
|
||||||
else:
|
else:
|
||||||
customer_id = self.env['hms.customer'].create(customer).id
|
customer_id = self.env['exely.customer'].create(customer).id
|
||||||
data['customer'] = customer_id
|
data['customer'] = customer_id
|
||||||
|
|
||||||
roomstays = data.pop('roomStays', None)
|
roomstays = data.pop('roomStays', None)
|
||||||
@ -364,58 +303,9 @@ class ExelyModifiedData(models.Model):
|
|||||||
for roomstay in roomstays:
|
for roomstay in roomstays:
|
||||||
roomstay['bid'] = roomstay.pop('id')
|
roomstay['bid'] = roomstay.pop('id')
|
||||||
|
|
||||||
status = roomstay.pop('status', None)
|
if roomstay.get('roomId', None):
|
||||||
if status:
|
roomstay['roomId'] = self.env['exely.rooms'].search([('bid', '=', roomstay['roomId'])]).id
|
||||||
found_status_id = self.env['hms.status'].search([('name', '=', status)])
|
|
||||||
if found_status_id:
|
|
||||||
status_id = found_status_id.id
|
|
||||||
else:
|
|
||||||
status_id = self.env['hms.status'].create({'name': status}).id
|
|
||||||
roomstay['status'] = status_id
|
|
||||||
|
|
||||||
bookingstatus = roomstay.pop('bookingStatus', None)
|
|
||||||
if bookingstatus:
|
|
||||||
found_bookingstatus_id = self.env['hms.booking.status'].search([('name', '=', bookingstatus)])
|
|
||||||
if found_bookingstatus_id:
|
|
||||||
bookingstatus_id = found_bookingstatus_id.id
|
|
||||||
else:
|
|
||||||
bookingstatus_id = self.env['hms.booking.status'].create({'name': bookingstatus}).id
|
|
||||||
roomstay['bookingStatus'] = bookingstatus_id
|
|
||||||
|
|
||||||
roomTypeId = roomstay.get('roomTypeId', None)
|
|
||||||
if roomTypeId:
|
|
||||||
found_roomtype = self.env['hms.room.types'].search([('bid', '=', roomTypeId)])
|
|
||||||
if found_roomtype:
|
|
||||||
roomtype_id = found_roomtype.id
|
|
||||||
else:
|
|
||||||
roomtype_id = self.env['hms.room.types'].create({'bid': roomTypeId}).id
|
|
||||||
roomstay['roomTypeId'] = roomtype_id
|
|
||||||
|
|
||||||
roomId = roomstay.get('roomId', None)
|
|
||||||
if roomId:
|
|
||||||
found_raw_room = self.env['exely.raw.rooms'].search([('bid', '=', roomId)])
|
|
||||||
if found_raw_room:
|
|
||||||
room_data = json.loads(found_raw_room.json_data)
|
|
||||||
room_data['bid'] = room_data.pop('id')
|
|
||||||
roomTypeId = room_data.get('roomTypeId', None)
|
|
||||||
if roomTypeId:
|
|
||||||
found_roomtype = self.env['hms.room.types'].search([('bid', '=', roomTypeId)])
|
|
||||||
if found_roomtype:
|
|
||||||
roomtype_id = found_roomtype.id
|
|
||||||
else:
|
|
||||||
roomtype_id = self.env['hms.room.types'].create({'bid': roomTypeId}).id
|
|
||||||
room_data['roomTypeId'] = roomtype_id
|
|
||||||
|
|
||||||
found_room = self.env['hms.rooms'].search([('bid', '=', roomId)])
|
|
||||||
if found_room:
|
|
||||||
room_id = found_room.id
|
|
||||||
else:
|
|
||||||
room_id = self.env['hms.rooms'].create(room_data).id
|
|
||||||
|
|
||||||
roomstay['roomId'] = room_id
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
guests = roomstay.pop('guestsIds', None)
|
guests = roomstay.pop('guestsIds', None)
|
||||||
|
|
||||||
if guests:
|
if guests:
|
||||||
@ -427,22 +317,22 @@ class ExelyModifiedData(models.Model):
|
|||||||
if guest_data:
|
if guest_data:
|
||||||
if guest_data.get('emails', None):
|
if guest_data.get('emails', None):
|
||||||
guest_data['emails'] = [(6, 0, [
|
guest_data['emails'] = [(6, 0, [
|
||||||
self.env['hms.email'].search([('email', '=', email)], limit=1).id or
|
self.env['exely.email'].search([('email', '=', email)], limit=1).id or
|
||||||
self.env['hms.email'].create({'email': email}).id
|
self.env['exely.email'].create({'email': email}).id
|
||||||
for email in guest_data['emails']
|
for email in guest_data['emails']
|
||||||
])]
|
])]
|
||||||
if guest_data.get('phones', None):
|
if guest_data.get('phones', None):
|
||||||
guest_data['phones'] = [(6, 0, [
|
guest_data['phones'] = [(6, 0, [
|
||||||
self.env['hms.phones'].search([('phone', '=', phone)], limit=1).id or
|
self.env['exely.phones'].search([('phone', '=', phone)], limit=1).id or
|
||||||
self.env['hms.phones'].create({'phone': phone}).id
|
self.env['exely.phones'].create({'phone': phone}).id
|
||||||
for phone in guest_data['phones']
|
for phone in guest_data['phones']
|
||||||
])]
|
])]
|
||||||
|
|
||||||
found_guest = self.env['hms.guests'].search([('bid', '=', guest)])
|
found_guest = self.env['exely.guests'].search([('bid', '=', guest)])
|
||||||
if found_guest:
|
if found_guest:
|
||||||
guest_id = found_guest.id
|
guest_id = found_guest.id
|
||||||
else:
|
else:
|
||||||
guest_id = self.env['hms.guests'].create(guest_data).id
|
guest_id = self.env['exely.guests'].create(guest_data).id
|
||||||
guest_ids.append(guest_id)
|
guest_ids.append(guest_id)
|
||||||
|
|
||||||
if guest_ids:
|
if guest_ids:
|
||||||
@ -453,41 +343,32 @@ class ExelyModifiedData(models.Model):
|
|||||||
if not amenities:
|
if not amenities:
|
||||||
amenity_ids = []
|
amenity_ids = []
|
||||||
for amenity in amenities:
|
for amenity in amenities:
|
||||||
found_amenity = self.env['hms.amenities'].search([('name', '=', amenity)])
|
found_amenity = self.env['exely.amenities'].search([('name', '=', amenity)])
|
||||||
if found_amenity:
|
if found_amenity:
|
||||||
amenity_id = found_amenity.id
|
amenity_id = found_amenity.id
|
||||||
else:
|
else:
|
||||||
amenity_id = self.env['hms.amenities'].create({'name': amenity}).id
|
amenity_id = self.env['exely.amenities'].create({'name': amenity}).id
|
||||||
amenity_ids.append(amenity_id)
|
amenity_ids.append(amenity_id)
|
||||||
|
|
||||||
if amenity_ids:
|
if amenity_ids:
|
||||||
roomstay['amenities'] = [(6, 0, amenity_ids)]
|
roomstay['amenities'] = [(6, 0, amenity_ids)]
|
||||||
|
|
||||||
found_roomstay = self.env['hms.roomstays'].search([('bid', '=', roomstay['bid'])])
|
found_roomstay = self.env['exely.roomstays'].search([('bid', '=', roomstay['bid'])])
|
||||||
if found_roomstay:
|
if found_roomstay:
|
||||||
roomstay_id = found_roomstay.id
|
roomstay_id = found_roomstay.id
|
||||||
else:
|
else:
|
||||||
roomstay_id = self.env['hms.roomstays'].create(roomstay).id
|
roomstay_id = self.env['exely.roomstays'].create(roomstay).id
|
||||||
roomstays_ids.append(roomstay_id)
|
roomstays_ids.append(roomstay_id)
|
||||||
|
|
||||||
if roomstays_ids:
|
if roomstays_ids:
|
||||||
data['roomStays'] = [(6, 0, roomstays_ids)]
|
data['roomStays'] = [(6, 0, roomstays_ids)]
|
||||||
|
|
||||||
sourceChannelName = data.pop('sourceChannelName', None)
|
|
||||||
if sourceChannelName:
|
|
||||||
found_source_channel = self.env['hms.source.channel'].search([('name', '=', sourceChannelName)])
|
|
||||||
if found_source_channel:
|
|
||||||
source_channel_id = found_source_channel.id
|
|
||||||
else:
|
|
||||||
source_channel_id = self.env['hms.source.channel'].create({'name': sourceChannelName}).id
|
|
||||||
data['sourceChannelName'] = source_channel_id
|
|
||||||
|
|
||||||
to_create.append(data)
|
to_create.append(data)
|
||||||
|
|
||||||
if to_create:
|
if to_create:
|
||||||
for i in to_create:
|
for i in to_create:
|
||||||
try:
|
try:
|
||||||
self.env['hms.bookings'].create(i)
|
self.env['exely.bookings'].create(i)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
_logger.warning(f"##############################: {i}")
|
_logger.warning(f"##############################: {i}")
|
||||||
|
|
||||||
@ -640,9 +521,9 @@ class ExelyModifiedData(models.Model):
|
|||||||
# self.env['exely.bookings'].create(to_create)
|
# self.env['exely.bookings'].create(to_create)
|
||||||
|
|
||||||
|
|
||||||
class HmsBookings(models.Model):
|
class ExcelyBookings(models.Model):
|
||||||
_inherit = 'hms.bookings'
|
_inherit = 'exely.bookings'
|
||||||
_description = 'Hms Bookings'
|
_description = 'Exely Bookings'
|
||||||
_rec_name = 'bid'
|
_rec_name = 'bid'
|
||||||
|
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<menuitem name="HMS Integrations" id="exely_integration_submenu" sequence="20"/>
|
<menuitem name="Exely Integration" id="exely_integration_submenu" parent="bross_hms.exely_root_menu" sequence="10"/>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
@ -1,27 +0,0 @@
|
|||||||
Odoo Proprietary License v1.0
|
|
||||||
|
|
||||||
This software and associated files (the "Software") may only be used (executed,
|
|
||||||
modified, executed after modifications) if you have purchased a valid license
|
|
||||||
from the authors, typically via Odoo Apps, or if you have received a written
|
|
||||||
agreement from the authors of the Software (see the COPYRIGHT file).
|
|
||||||
|
|
||||||
You may develop Odoo modules that use the Software as a library (typically
|
|
||||||
by depending on it, importing it and using its resources), but without copying
|
|
||||||
any source code or material from the Software. You may distribute those
|
|
||||||
modules under the license of your choice, provided that this license is
|
|
||||||
compatible with the terms of the Odoo Proprietary License (For example:
|
|
||||||
LGPL, MIT, or proprietary licenses similar to this one).
|
|
||||||
|
|
||||||
It is forbidden to publish, distribute, sublicense, or sell copies of the Software
|
|
||||||
or modified copies of the Software.
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice must be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
||||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
||||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
||||||
DEALINGS IN THE SOFTWARE.
|
|
||||||
@ -1 +0,0 @@
|
|||||||
from . import models
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
{
|
|
||||||
'name': "NBG exchange rates",
|
|
||||||
'summary': """NBG exchange rates.""",
|
|
||||||
'description':
|
|
||||||
"""
|
|
||||||
NBG exchange rates.
|
|
||||||
""",
|
|
||||||
'author': "mgite",
|
|
||||||
# 'website': "https://example.com",
|
|
||||||
'price': '5.0',
|
|
||||||
'currency': 'EUR',
|
|
||||||
'support': 'matemana2608@gmail.com',
|
|
||||||
'license': 'OPL-1',
|
|
||||||
'category': 'Tools',
|
|
||||||
'version': '18.0.1.0.0',
|
|
||||||
'images': ['static/description/wallpaper.png'],
|
|
||||||
'depends': [
|
|
||||||
'base',
|
|
||||||
],
|
|
||||||
'data': [
|
|
||||||
'cron/ir_cron.xml',
|
|
||||||
],
|
|
||||||
'installable': True,
|
|
||||||
'application': True,
|
|
||||||
'auto_install': False,
|
|
||||||
}
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<odoo>
|
|
||||||
<data noupdate="1">
|
|
||||||
<record id="get_exchange_rates_from_nbg" model="ir.cron">
|
|
||||||
<field name="name">NBG: get exchange rates</field>
|
|
||||||
<field name="model_id" ref="base.model_res_currency"/>
|
|
||||||
<field name="state">code</field>
|
|
||||||
<field name="code">model.get_exchange_rates()</field>
|
|
||||||
<field name="interval_number">1</field>
|
|
||||||
<field name="interval_type">days</field>
|
|
||||||
<!-- <field name="numbercall">-1</field> -->
|
|
||||||
<!-- <field name="doall" eval="False" /> -->
|
|
||||||
<field name="active" eval="True"/>
|
|
||||||
<field name="priority">5</field>
|
|
||||||
</record>
|
|
||||||
</data>
|
|
||||||
</odoo>
|
|
||||||
@ -1 +0,0 @@
|
|||||||
from . import res_currency
|
|
||||||
@ -1,45 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from odoo import models, fields, api
|
|
||||||
from odoo.exceptions import UserError, ValidationError
|
|
||||||
from zeep import Client
|
|
||||||
import logging
|
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class ResCurrency(models.Model):
|
|
||||||
_inherit = "res.currency"
|
|
||||||
|
|
||||||
@api.model
|
|
||||||
def get_exchange_rates(self):
|
|
||||||
default_currency = self.env.ref('base.main_company').currency_id
|
|
||||||
active_currencies = self.env['res.currency'].search([('active','=',True)])
|
|
||||||
WSDLFILE = 'https://services.nbg.gov.ge/Rates/Service.asmx?wsdl'
|
|
||||||
|
|
||||||
try:
|
|
||||||
_server = Client(WSDLFILE)
|
|
||||||
if default_currency.name == 'GEL':
|
|
||||||
base_rate = 1.0
|
|
||||||
else:
|
|
||||||
base_rate = _server.service.GetCurrentRates(default_currency.name)[0].Rate
|
|
||||||
date = _server.service.GetCurrentRates()[0].Date
|
|
||||||
|
|
||||||
for currency in active_currencies:
|
|
||||||
if currency.rate_ids.filtered(lambda r: r.name == fields.Date.today()):
|
|
||||||
continue
|
|
||||||
if currency.name != 'GEL':
|
|
||||||
found_currency_obj = _server.service.GetCurrentRates(currency.name)
|
|
||||||
if found_currency_obj:
|
|
||||||
rate_obj = found_currency_obj[0]
|
|
||||||
rate_num = rate_obj.Rate
|
|
||||||
currency_amount = rate_obj.Quantity
|
|
||||||
if currency_amount and int(currency_amount) != 1:
|
|
||||||
rate_num = float(rate_num) / int(currency_amount)
|
|
||||||
if rate_num:
|
|
||||||
calculated_rate = float(base_rate) / float(rate_num)
|
|
||||||
calculated_rate = 1 / calculated_rate
|
|
||||||
currency.write({'rate_ids': [(0, 0, {'name': date, 'rate': calculated_rate})]})
|
|
||||||
else:
|
|
||||||
currency.write({'rate_ids': [(0, 0, {'name': date, 'rate': float(base_rate)})]})
|
|
||||||
except Exception as e:
|
|
||||||
_logger.error(f"Failed to get echange rates. {e}")
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 48 KiB |
@ -1,23 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8"/>
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<title>NBG exchange rates</title>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body style="background: #f3f3f3;">
|
|
||||||
<section class="mb-5">
|
|
||||||
<div class="container text-center">
|
|
||||||
<h1 class="pb-4 d-flex justify-content-center" style="color: #a3498b;">
|
|
||||||
<span class="ml-2">Details</span>
|
|
||||||
</h1>
|
|
||||||
<p class="mb-5" style="font-size: 26px;font-weight: 500;letter-spacing: 0.02em;color: #535456;">
|
|
||||||
This module leverages NBG services to fetch the latest currency exchange rates for currencies currently in use within Odoo. The retrieved rates are then seamlessly stored in the database, ensuring accurate and up-to-date financial information.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 MiB |
Loading…
Reference in New Issue
Block a user