-
+
diff --git a/bross_hms/views/status.xml b/bross_hms/views/status.xml
new file mode 100644
index 0000000..1e418d4
--- /dev/null
+++ b/bross_hms/views/status.xml
@@ -0,0 +1,52 @@
+
+
+
+
+ Status
+ hms.status
+
+
+
+
+
+
+
+
+ Status
+ hms.status
+ list
+
+
+ Create your first status record.
+
+
+
+
+
+
+
+
+
+ Booking Status
+ hms.booking.status
+
+
+
+
+
+
+
+
+ Booking Status
+ hms.booking.status
+ list
+
+
+ Create your first booking status record.
+
+
+
+
+
+
+
diff --git a/docker-compose.yml b/docker-compose.yml
index 6c94c7c..1ecf99d 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -20,8 +20,8 @@ services:
- 5678:5678
# - 8069:8069
volumes:
- - /opt/nvme_disk/docker_data/code_server/code_projects/odoo18/:/opt/odoo/
- - /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/config/workspace/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_data/odoo18_odoo_filestore:/root/.local/share/Odoo/
depends_on:
- db
@@ -37,7 +37,7 @@ services:
ports:
- 80:80
volumes:
- - /opt/nvme_disk/docker_data/code_server/code_projects/odoo18/customaddons/${CUSTOMADDONS_DIR}/nginx.conf:/etc/nginx/conf.d/default.conf
+ - /opt/nvme_disk/docker_data/code_server/config/workspace/odoo18/customaddons/${CUSTOMADDONS_DIR}/nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
- odoo
diff --git a/exely_integration/models/exely_raw_data.py b/exely_integration/models/exely_raw_data.py
index 85be3c0..7d6b75e 100644
--- a/exely_integration/models/exely_raw_data.py
+++ b/exely_integration/models/exely_raw_data.py
@@ -260,7 +260,7 @@ class ExelyModifiedData(models.Model):
## break
def process_exely_data(self):
- found_booking_record = self.env['exely.bookings'].search([], order="write_date desc", limit=1)
+ found_booking_record = self.env['hms.bookings'].search([], order="write_date desc", limit=1)
if found_booking_record:
max_date = found_booking_record.write_date
else:
@@ -279,22 +279,22 @@ class ExelyModifiedData(models.Model):
customer['bid'] = customer.pop('id')
if customer.get('emails', None):
customer['emails'] = [(6, 0, [
- self.env['exely.email'].search([('email', '=', email)], limit=1).id or
- self.env['exely.email'].create({'email': email}).id
+ self.env['hms.email'].search([('email', '=', email)], limit=1).id or
+ self.env['hms.email'].create({'email': email}).id
for email in customer['emails']
])]
if customer.get('phones', None):
customer['phones'] = [(6, 0, [
- self.env['exely.phones'].search([('phone', '=', phone)], limit=1).id or
- self.env['exely.phones'].create({'phone': phone}).id
+ self.env['hms.phones'].search([('phone', '=', phone)], limit=1).id or
+ self.env['hms.phones'].create({'phone': phone}).id
for phone in customer['phones']
])]
- found_customer = self.env['exely.customer'].search([('bid', '=', customer['bid'])])
+ found_customer = self.env['hms.customer'].search([('bid', '=', customer['bid'])])
if found_customer:
customer_id = found_customer.id
else:
- customer_id = self.env['exely.customer'].create(customer).id
+ customer_id = self.env['hms.customer'].create(customer).id
data['customer'] = customer_id
roomstays = data.pop('roomStays', None)
@@ -304,7 +304,7 @@ class ExelyModifiedData(models.Model):
roomstay['bid'] = roomstay.pop('id')
if roomstay.get('roomId', None):
- roomstay['roomId'] = self.env['exely.rooms'].search([('bid', '=', roomstay['roomId'])]).id
+ roomstay['roomId'] = self.env['hms.rooms'].search([('bid', '=', roomstay['roomId'])]).id
guests = roomstay.pop('guestsIds', None)
@@ -317,22 +317,22 @@ class ExelyModifiedData(models.Model):
if guest_data:
if guest_data.get('emails', None):
guest_data['emails'] = [(6, 0, [
- self.env['exely.email'].search([('email', '=', email)], limit=1).id or
- self.env['exely.email'].create({'email': email}).id
+ self.env['hms.email'].search([('email', '=', email)], limit=1).id or
+ self.env['hms.email'].create({'email': email}).id
for email in guest_data['emails']
])]
if guest_data.get('phones', None):
guest_data['phones'] = [(6, 0, [
- self.env['exely.phones'].search([('phone', '=', phone)], limit=1).id or
- self.env['exely.phones'].create({'phone': phone}).id
+ self.env['hms.phones'].search([('phone', '=', phone)], limit=1).id or
+ self.env['hms.phones'].create({'phone': phone}).id
for phone in guest_data['phones']
])]
- found_guest = self.env['exely.guests'].search([('bid', '=', guest)])
+ found_guest = self.env['hms.guests'].search([('bid', '=', guest)])
if found_guest:
guest_id = found_guest.id
else:
- guest_id = self.env['exely.guests'].create(guest_data).id
+ guest_id = self.env['hms.guests'].create(guest_data).id
guest_ids.append(guest_id)
if guest_ids:
@@ -343,21 +343,21 @@ class ExelyModifiedData(models.Model):
if not amenities:
amenity_ids = []
for amenity in amenities:
- found_amenity = self.env['exely.amenities'].search([('name', '=', amenity)])
+ found_amenity = self.env['hms.amenities'].search([('name', '=', amenity)])
if found_amenity:
amenity_id = found_amenity.id
else:
- amenity_id = self.env['exely.amenities'].create({'name': amenity}).id
+ amenity_id = self.env['hms.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'])])
+ found_roomstay = self.env['hms.roomstays'].search([('bid', '=', roomstay['bid'])])
if found_roomstay:
roomstay_id = found_roomstay.id
else:
- roomstay_id = self.env['exely.roomstays'].create(roomstay).id
+ roomstay_id = self.env['hms.roomstays'].create(roomstay).id
roomstays_ids.append(roomstay_id)
if roomstays_ids:
@@ -368,7 +368,7 @@ class ExelyModifiedData(models.Model):
if to_create:
for i in to_create:
try:
- self.env['exely.bookings'].create(i)
+ self.env['hms.bookings'].create(i)
except Exception as e:
_logger.warning(f"##############################: {i}")
@@ -521,9 +521,9 @@ class ExelyModifiedData(models.Model):
# self.env['exely.bookings'].create(to_create)
-class ExcelyBookings(models.Model):
- _inherit = 'exely.bookings'
- _description = 'Exely Bookings'
+class HmsBookings(models.Model):
+ _inherit = 'hms.bookings'
+ _description = 'Hms Bookings'
_rec_name = 'bid'
\ No newline at end of file
diff --git a/exely_integration/views/main_menu.xml b/exely_integration/views/main_menu.xml
index 6fa9ec0..6fcbd6f 100644
--- a/exely_integration/views/main_menu.xml
+++ b/exely_integration/views/main_menu.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/nbg_exchange_rates/LICENSE b/nbg_exchange_rates/LICENSE
new file mode 100644
index 0000000..b01eaf1
--- /dev/null
+++ b/nbg_exchange_rates/LICENSE
@@ -0,0 +1,27 @@
+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.
diff --git a/nbg_exchange_rates/__init__.py b/nbg_exchange_rates/__init__.py
new file mode 100644
index 0000000..9a7e03e
--- /dev/null
+++ b/nbg_exchange_rates/__init__.py
@@ -0,0 +1 @@
+from . import models
\ No newline at end of file
diff --git a/nbg_exchange_rates/__manifest__.py b/nbg_exchange_rates/__manifest__.py
new file mode 100644
index 0000000..cca80a8
--- /dev/null
+++ b/nbg_exchange_rates/__manifest__.py
@@ -0,0 +1,27 @@
+# -*- 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,
+}
diff --git a/nbg_exchange_rates/cron/ir_cron.xml b/nbg_exchange_rates/cron/ir_cron.xml
new file mode 100644
index 0000000..a9d1e2b
--- /dev/null
+++ b/nbg_exchange_rates/cron/ir_cron.xml
@@ -0,0 +1,17 @@
+
+
+
+
+ NBG: get exchange rates
+
+ code
+ model.get_exchange_rates()
+ 1
+ days
+
+
+
+ 5
+
+
+
\ No newline at end of file
diff --git a/nbg_exchange_rates/models/__init__.py b/nbg_exchange_rates/models/__init__.py
new file mode 100644
index 0000000..c1eedcb
--- /dev/null
+++ b/nbg_exchange_rates/models/__init__.py
@@ -0,0 +1 @@
+from . import res_currency
\ No newline at end of file
diff --git a/nbg_exchange_rates/models/res_currency.py b/nbg_exchange_rates/models/res_currency.py
new file mode 100644
index 0000000..68dd6f0
--- /dev/null
+++ b/nbg_exchange_rates/models/res_currency.py
@@ -0,0 +1,45 @@
+# -*- 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}")
diff --git a/nbg_exchange_rates/static/description/icon.png b/nbg_exchange_rates/static/description/icon.png
new file mode 100644
index 0000000..71a4bf2
Binary files /dev/null and b/nbg_exchange_rates/static/description/icon.png differ
diff --git a/nbg_exchange_rates/static/description/index.html b/nbg_exchange_rates/static/description/index.html
new file mode 100644
index 0000000..bc69256
--- /dev/null
+++ b/nbg_exchange_rates/static/description/index.html
@@ -0,0 +1,23 @@
+
+
+
+
+
+ NBG exchange rates
+
+
+
+
+
+
+
+
+ Details
+
+
+ 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.
+
+
+
+
+
diff --git a/nbg_exchange_rates/static/description/wallpaper.png b/nbg_exchange_rates/static/description/wallpaper.png
new file mode 100644
index 0000000..227b372
Binary files /dev/null and b/nbg_exchange_rates/static/description/wallpaper.png differ