Redesign all models and add new
This commit is contained in:
parent
d4e0bf734f
commit
1018350c76
@ -18,6 +18,8 @@
|
|||||||
'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,
|
||||||
|
|||||||
@ -2,3 +2,5 @@ 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,4 +1,5 @@
|
|||||||
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'
|
||||||
|
|||||||
9
bross_bank_management/models/bank_deposits.py
Normal file
9
bross_bank_management/models/bank_deposits.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
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')
|
||||||
9
bross_bank_management/models/service_payments.py
Normal file
9
bross_bank_management/models/service_payments.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
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')
|
||||||
@ -3,3 +3,5 @@ access_brosse_bank_user,access_brosse_bank,model_brosse_bank,base.group_user,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
|
||||||
|
26
bross_bank_management/views/bank_deposits_views.xml
Normal file
26
bross_bank_management/views/bank_deposits_views.xml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<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="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.exely_root_menu" sequence="40"/>
|
<menuitem name="Bank Management" id="bank_management_submenu" parent="bross_hms.property_management_root_menu" sequence="10"/>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
26
bross_bank_management/views/service_payments_views.xml
Normal file
26
bross_bank_management/views/service_payments_views.xml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<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>
|
||||||
@ -22,7 +22,12 @@
|
|||||||
'views/amenities.xml',
|
'views/amenities.xml',
|
||||||
'views/roomstays.xml',
|
'views/roomstays.xml',
|
||||||
'views/bookings.xml',
|
'views/bookings.xml',
|
||||||
|
'views/status.xml',
|
||||||
],
|
],
|
||||||
# only loaded in demonstration mode
|
'assets': {
|
||||||
|
'web.assets_backend': [
|
||||||
|
'bross_hms/static/src/scss/required.scss',
|
||||||
|
],
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from . import exely_data
|
from . import hms_data
|
||||||
|
|||||||
@ -11,25 +11,25 @@ _logger = logging.getLogger(__name__)
|
|||||||
STATES = ['Active', 'Cancelled']
|
STATES = ['Active', 'Cancelled']
|
||||||
|
|
||||||
|
|
||||||
class ExelyEmail(models.Model):
|
class HmsEmail(models.Model):
|
||||||
_name = 'exely.email'
|
_name = 'hms.email'
|
||||||
_description = 'Exely Email'
|
_description = 'Hms Email'
|
||||||
_rec_name = 'email'
|
_rec_name = 'email'
|
||||||
|
|
||||||
email = fields.Char(string="Email")
|
email = fields.Char(string="Email")
|
||||||
|
|
||||||
|
|
||||||
class ExelyPhones(models.Model):
|
class HmsPhones(models.Model):
|
||||||
_name = 'exely.phones'
|
_name = 'hms.phones'
|
||||||
_description = 'Exely Phones'
|
_description = 'Hms Phones'
|
||||||
_rec_name = 'phone'
|
_rec_name = 'phone'
|
||||||
|
|
||||||
phone = fields.Char(string="Phone")
|
phone = fields.Char(string="Phone")
|
||||||
|
|
||||||
|
|
||||||
class ExelyCustomer(models.Model):
|
class HmsCustomer(models.Model):
|
||||||
_name = 'exely.customer'
|
_name = 'hms.customer'
|
||||||
_description = 'Exely Customer'
|
_description = 'Hms Customer'
|
||||||
_rec_name = 'bid'
|
_rec_name = 'bid'
|
||||||
|
|
||||||
bid = fields.Char(string="Customer ID", index=True)
|
bid = fields.Char(string="Customer ID", index=True)
|
||||||
@ -39,14 +39,14 @@ class ExelyCustomer(models.Model):
|
|||||||
birthDate = fields.Char(string="Birth Date")
|
birthDate = fields.Char(string="Birth Date")
|
||||||
citizenshipCode = fields.Char(string="Citizenship Code")
|
citizenshipCode = fields.Char(string="Citizenship Code")
|
||||||
status = fields.Json(string="Status")
|
status = fields.Json(string="Status")
|
||||||
emails = fields.Many2many(comodel_name="exely.email", string="Emails")
|
emails = fields.Many2many(comodel_name="hms.email", string="Emails")
|
||||||
phones = fields.Many2many(comodel_name="exely.phones", string="Phones")
|
phones = fields.Many2many(comodel_name="hms.phones", string="Phones")
|
||||||
gender = fields.Char(string="Gender")
|
gender = fields.Char(string="Gender")
|
||||||
|
|
||||||
|
|
||||||
class ExelyRooms(models.Model):
|
class HmsRooms(models.Model):
|
||||||
_name = 'exely.rooms'
|
_name = 'hms.rooms'
|
||||||
_description = 'Exely Rooms'
|
_description = 'Hms Rooms'
|
||||||
_rec_name = 'name'
|
_rec_name = 'name'
|
||||||
|
|
||||||
bid = fields.Char(string="Room ID", index=True)
|
bid = fields.Char(string="Room ID", index=True)
|
||||||
@ -55,9 +55,9 @@ class ExelyRooms(models.Model):
|
|||||||
floorId = fields.Char(string="Floor ID")
|
floorId = fields.Char(string="Floor ID")
|
||||||
|
|
||||||
|
|
||||||
class ExelyGuests(models.Model):
|
class HmsGuests(models.Model):
|
||||||
_name = 'exely.guests'
|
_name = 'hms.guests'
|
||||||
_description = 'Exely Guests'
|
_description = 'Hms Guests'
|
||||||
_rec_name = 'bid'
|
_rec_name = 'bid'
|
||||||
|
|
||||||
bid = fields.Char(string="Guest ID", index=True)
|
bid = fields.Char(string="Guest ID", index=True)
|
||||||
@ -67,29 +67,29 @@ class ExelyGuests(models.Model):
|
|||||||
birthDate = fields.Char(string="Birth Date")
|
birthDate = fields.Char(string="Birth Date")
|
||||||
citizenshipCode = fields.Char(string="Citizenship Code")
|
citizenshipCode = fields.Char(string="Citizenship Code")
|
||||||
status = fields.Json(string="Status")
|
status = fields.Json(string="Status")
|
||||||
emails = fields.Many2many(comodel_name="exely.email", string="Emails")
|
emails = fields.Many2many(comodel_name="hms.email", string="Emails")
|
||||||
phones = fields.Many2many(comodel_name="exely.phones", string="Phones")
|
phones = fields.Many2many(comodel_name="hms.phones", string="Phones")
|
||||||
gender = fields.Char(string="Gender")
|
gender = fields.Char(string="Gender")
|
||||||
|
|
||||||
|
|
||||||
class ExelyAmenities(models.Model):
|
class HmsAmenities(models.Model):
|
||||||
_name = 'exely.amenities'
|
_name = 'hms.amenities'
|
||||||
_description = 'Exely Amenities'
|
_description = 'Hms Amenities'
|
||||||
_rec_name = 'name'
|
_rec_name = 'name'
|
||||||
|
|
||||||
name = fields.Char(string="Name")
|
name = fields.Char(string="Name")
|
||||||
|
|
||||||
|
|
||||||
class ExelyRoomStays(models.Model):
|
class HmsRoomStays(models.Model):
|
||||||
_name = 'exely.roomstays'
|
_name = 'hms.roomstays'
|
||||||
_description = 'Exely RoomStays'
|
_description = 'Hms RoomStays'
|
||||||
_rec_name = 'bid'
|
_rec_name = 'bid'
|
||||||
|
|
||||||
bid = fields.Char(string="Room raw ID", index=True)
|
bid = fields.Char(string="Room raw ID", index=True)
|
||||||
bookingId = fields.Char(string="Booking ID", index=True)
|
bookingId = fields.Char(string="Booking ID", index=True)
|
||||||
roomId = fields.Many2one(comodel_name="exely.rooms", string="Room ID")
|
roomId = fields.Many2one(comodel_name="hms.rooms", string="Room ID")
|
||||||
roomTypeId = fields.Char(string="Room Type ID")
|
roomTypeId = fields.Char(string="Room Type ID")
|
||||||
guestsIds = fields.Many2many(comodel_name="exely.guests", string="Guests Ids")
|
guestsIds = fields.Many2many(comodel_name="hms.guests", string="Guests Ids")
|
||||||
checkInDateTime = fields.Char(string="Check In Date Time")
|
checkInDateTime = fields.Char(string="Check In Date Time")
|
||||||
checkOutDateTime = fields.Char(string="Check Out Date Time")
|
checkOutDateTime = fields.Char(string="Check Out Date Time")
|
||||||
actualCheckInDateTime = fields.Char(string="Actual Check In Date Time")
|
actualCheckInDateTime = fields.Char(string="Actual Check In Date Time")
|
||||||
@ -98,16 +98,16 @@ class ExelyRoomStays(models.Model):
|
|||||||
bookingStatus = fields.Char(string="Booking Status")
|
bookingStatus = fields.Char(string="Booking Status")
|
||||||
guestCountInfo = fields.Json(string="Guest Count Info")
|
guestCountInfo = fields.Json(string="Guest Count Info")
|
||||||
totalPrice = fields.Json(string="Total Price")
|
totalPrice = fields.Json(string="Total Price")
|
||||||
amenities = fields.Many2many(comodel_name="exely.amenities", string="Amenities")
|
amenities = fields.Many2many(comodel_name="hms.amenities", string="Amenities")
|
||||||
|
|
||||||
bookings_id = fields.Many2one(comodel_name="exely.bookings", string="Room Stay Id")
|
bookings_id = fields.Many2one(comodel_name="hms.bookings", string="Room Stay Id")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ExcelyBookings(models.Model):
|
class HmsBookings(models.Model):
|
||||||
_name = 'exely.bookings'
|
_name = 'hms.bookings'
|
||||||
_description = 'Exely Bookings'
|
_description = 'Hms Bookings'
|
||||||
_rec_name = 'bid'
|
_rec_name = 'bid'
|
||||||
|
|
||||||
bid = fields.Char(string="Booking ID", index=True)
|
bid = fields.Char(string="Booking ID", index=True)
|
||||||
@ -118,8 +118,22 @@ class ExcelyBookings(models.Model):
|
|||||||
lastModified = fields.Char(string="Last Modified")
|
lastModified = fields.Char(string="Last Modified")
|
||||||
groupName = fields.Char(string="Group Name")
|
groupName = fields.Char(string="Group Name")
|
||||||
currencyId = fields.Char(string="Currency ID")
|
currencyId = fields.Char(string="Currency ID")
|
||||||
customer = fields.Many2one(comodel_name="exely.customer", string="Customer")
|
customer = fields.Many2one(comodel_name="hms.customer", string="Customer")
|
||||||
roomStays = fields.One2many(comodel_name="exely.roomstays", inverse_name="bookings_id", string="RoomStays")
|
roomStays = fields.One2many(comodel_name="hms.roomstays", inverse_name="bookings_id", string="RoomStays")
|
||||||
customerCompany = fields.Json(string="Customer Company")
|
customerCompany = fields.Json(string="Customer Company")
|
||||||
source = fields.Json(string="RoomStays (Json)")
|
source = fields.Json(string="RoomStays (Json)")
|
||||||
sourceChannelName = fields.Char(string="Source Channel Name")
|
sourceChannelName = fields.Char(string="Source Channel Name")
|
||||||
|
|
||||||
|
|
||||||
|
class HmsStatus(models.Model):
|
||||||
|
_name = 'hms.status'
|
||||||
|
_description = 'Hms Status'
|
||||||
|
|
||||||
|
name = fields.Char(string="Status", required=True)
|
||||||
|
|
||||||
|
|
||||||
|
class HmsBookingStatus(models.Model):
|
||||||
|
_name = 'hms.booking.status'
|
||||||
|
_description = 'Hms Booking Status'
|
||||||
|
|
||||||
|
name = fields.Char(string="Booking Status", required=True)
|
||||||
@ -1,11 +1,13 @@
|
|||||||
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_exely_bookings,access_exely_bookings,bross_hms.model_exely_bookings,base.group_user,1,1,1,1
|
bross_hms.access_hms_bookings,access_hms_bookings,bross_hms.model_hms_bookings,base.group_user,1,1,1,1
|
||||||
|
|
||||||
bross_hms.access_exely_email,access_exely_email,bross_hms.model_exely_email,base.group_user,1,1,1,1
|
bross_hms.access_hms_email,access_hms_email,bross_hms.model_hms_email,base.group_user,1,1,1,1
|
||||||
bross_hms.access_exely_phones,access_exely_phones,bross_hms.model_exely_phones,base.group_user,1,1,1,1
|
bross_hms.access_hms_phones,access_hms_phones,bross_hms.model_hms_phones,base.group_user,1,1,1,1
|
||||||
bross_hms.access_exely_customer,access_exely_customer,bross_hms.model_exely_customer,base.group_user,1,1,1,1
|
bross_hms.access_hms_customer,access_hms_customer,bross_hms.model_hms_customer,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_rooms,access_hms_rooms,bross_hms.model_hms_rooms,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_guests,access_hms_guests,bross_hms.model_hms_guests,base.group_user,1,1,1,1
|
||||||
bross_hms.access_exely_amenities,access_exely_amenities,bross_hms.model_exely_amenities,base.group_user,1,1,1,1
|
bross_hms.access_hms_amenities,access_hms_amenities,bross_hms.model_hms_amenities,base.group_user,1,1,1,1
|
||||||
bross_hms.access_exely_roomstays,access_exely_roomstays,bross_hms.model_exely_roomstays,base.group_user,1,1,1,1
|
bross_hms.access_hms_roomstays,access_hms_roomstays,bross_hms.model_hms_roomstays,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
|
||||||
|
27
bross_hms/static/src/scss/required.scss
Normal file
27
bross_hms/static/src/scss/required.scss
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
.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,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<record id="view_exely_amenities_tree" model="ir.ui.view">
|
<record id="view_hms_amenities_tree" model="ir.ui.view">
|
||||||
<field name="name">exely.amenities.tree</field>
|
<field name="name">Amenities</field>
|
||||||
<field name="model">exely.amenities</field>
|
<field name="model">hms.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_exely_amenities_action" model="ir.actions.act_window">
|
<record id="action_hms_amenities_action" model="ir.actions.act_window">
|
||||||
<field name="name">Exely Amenities</field>
|
<field name="name">Amenities</field>
|
||||||
<field name="res_model">exely.amenities</field>
|
<field name="res_model">hms.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_exely_amenities" name="Amenities" parent="exely_models_root_menu" sequence="60" action="action_exely_amenities_action"/>
|
<menuitem id="menu_hms_amenities" name="Amenities" parent="property_management_root_menu" sequence="30" action="action_hms_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_exely_bookings_tree" model="ir.ui.view">
|
<record id="view_hms_bookings_tree" model="ir.ui.view">
|
||||||
<field name="name">exely.bookings.tree</field>
|
<field name="name">Reception</field>
|
||||||
<field name="model">exely.bookings</field>
|
<field name="model">hms.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_exely_bookings_form" model="ir.ui.view">
|
<record id="view_hms_bookings_form" model="ir.ui.view">
|
||||||
<field name="name">exely.bookings.form</field>
|
<field name="name">Reception</field>
|
||||||
<field name="model">exely.bookings</field>
|
<field name="model">hms.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_exely_bookings_action" model="ir.actions.act_window">
|
<record id="action_hms_bookings_action" model="ir.actions.act_window">
|
||||||
<field name="name">Exely Bookings</field>
|
<field name="name">Reception</field>
|
||||||
<field name="res_model">exely.bookings</field>
|
<field name="res_model">hms.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="Bookings" parent="exely_root_menu" id="exely_bookings_root_menu" sequence="20" action="action_exely_bookings_action"/>
|
<menuitem name="Reception" parent="hms_root_menu" id="reception_root_menu" sequence="10" action="action_hms_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_exely_customer_tree" model="ir.ui.view">
|
<record id="view_hms_customer_tree" model="ir.ui.view">
|
||||||
<field name="name">exely.customer.tree</field>
|
<field name="name">Customer</field>
|
||||||
<field name="model">exely.customer</field>
|
<field name="model">hms.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_exely_customer_form" model="ir.ui.view">
|
<record id="view_hms_customer_form" model="ir.ui.view">
|
||||||
<field name="name">exely.customer.form</field>
|
<field name="name">Customer</field>
|
||||||
<field name="model">exely.customer</field>
|
<field name="model">hms.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_exely_customer_graph" model="ir.ui.view">
|
<!-- <record id="view_hms_customer_graph" model="ir.ui.view">
|
||||||
<field name="name">exely.customer.graph</field>
|
<field name="name">Customer</field>
|
||||||
<field name="model">exely.customer</field>
|
<field name="model">hms.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_exely_customer_action" model="ir.actions.act_window">
|
<record id="action_hms_customer_action" model="ir.actions.act_window">
|
||||||
<field name="name">Exely Customers</field>
|
<field name="name">Customer</field>
|
||||||
<field name="res_model">exely.customer</field>
|
<field name="res_model">hms.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_exely_customer" name="Customers" parent="exely_models_root_menu" sequence="30" action="action_exely_customer_action"/>
|
<menuitem id="menu_hms_customer" name="Customers" parent="customers_and_partners_root_menu" sequence="30" action="action_hms_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_exely_email_tree" model="ir.ui.view">
|
<record id="view_hms_email_tree" model="ir.ui.view">
|
||||||
<field name="name">exely.email.tree</field>
|
<field name="name">Email</field>
|
||||||
<field name="model">exely.email</field>
|
<field name="model">hms.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_exely_email_action" model="ir.actions.act_window">
|
<record id="action_hms_email_action" model="ir.actions.act_window">
|
||||||
<field name="name">Exely Emails</field>
|
<field name="name">Email</field>
|
||||||
<field name="res_model">exely.email</field>
|
<field name="res_model">hms.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_exely_email" name="Emails" parent="exely_models_root_menu" sequence="10" action="action_exely_email_action"/>
|
<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"/>
|
||||||
</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_exely_guests_tree" model="ir.ui.view">
|
<record id="view_hms_guests_tree" model="ir.ui.view">
|
||||||
<field name="name">exely.guests.tree</field>
|
<field name="name">Guest</field>
|
||||||
<field name="model">exely.guests</field>
|
<field name="model">hms.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_exely_guests_form" model="ir.ui.view">
|
<record id="view_hms_guests_form" model="ir.ui.view">
|
||||||
<field name="name">exely.guests.form</field>
|
<field name="name">Guest</field>
|
||||||
<field name="model">exely.guests</field>
|
<field name="model">hms.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_exely_guests_action" model="ir.actions.act_window">
|
<record id="action_hms_guests_action" model="ir.actions.act_window">
|
||||||
<field name="name">Exely Guests</field>
|
<field name="name">Guest</field>
|
||||||
<field name="res_model">exely.guests</field>
|
<field name="res_model">hms.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_exely_guests" name="Guests" parent="exely_models_root_menu" sequence="50" action="action_exely_guests_action"/>
|
<menuitem id="menu_hms_guests" name="Guests" parent="customers_and_partners_root_menu" sequence="50" action="action_hms_guests_action"/>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@ -1,7 +1,13 @@
|
|||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<menuitem name="HMS" id="exely_root_menu" sequence="10"/>
|
<menuitem name="HMS" id="hms_root_menu" sequence="10"/>
|
||||||
|
|
||||||
<menuitem name="HMS Models" parent="exely_root_menu" id="exely_models_root_menu" sequence="30"/>
|
<menuitem name="Customers & Partners" parent="hms_root_menu" id="customers_and_partners_root_menu" sequence="20"/>
|
||||||
|
|
||||||
|
<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_exely_phones_tree" model="ir.ui.view">
|
<record id="view_hms_phones_tree" model="ir.ui.view">
|
||||||
<field name="name">exely.phones.tree</field>
|
<field name="name">Phone</field>
|
||||||
<field name="model">exely.phones</field>
|
<field name="model">hms.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_exely_phones_action" model="ir.actions.act_window">
|
<record id="action_hms_phones_action" model="ir.actions.act_window">
|
||||||
<field name="name">Exely Phones</field>
|
<field name="name">Phone</field>
|
||||||
<field name="res_model">exely.phones</field>
|
<field name="res_model">hms.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_exely_phones" name="Phones" parent="exely_models_root_menu" sequence="20" action="action_exely_phones_action"/>
|
<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"/>
|
||||||
</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_exely_rooms_tree" model="ir.ui.view">
|
<record id="view_hms_rooms_tree" model="ir.ui.view">
|
||||||
<field name="name">exely.rooms.tree</field>
|
<field name="name">Room</field>
|
||||||
<field name="model">exely.rooms</field>
|
<field name="model">hms.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_exely_rooms_action" model="ir.actions.act_window">
|
<record id="action_hms_rooms_action" model="ir.actions.act_window">
|
||||||
<field name="name">Exely Rooms</field>
|
<field name="name">Room</field>
|
||||||
<field name="res_model">exely.rooms</field>
|
<field name="res_model">hms.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_exely_rooms" name="Rooms" parent="exely_models_root_menu" sequence="40" action="action_exely_rooms_action"/>
|
<menuitem id="menu_hms_rooms" name="Rooms" parent="property_management_root_menu" sequence="20" action="action_hms_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_exely_roomstays_tree" model="ir.ui.view">
|
<record id="view_hms_roomstays_tree" model="ir.ui.view">
|
||||||
<field name="name">exely.roomstays.tree</field>
|
<field name="name">Roomstays</field>
|
||||||
<field name="model">exely.roomstays</field>
|
<field name="model">hms.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_exely_roomstays_form" model="ir.ui.view">
|
<record id="view_hms_roomstays_form" model="ir.ui.view">
|
||||||
<field name="name">exely.roomstays.form</field>
|
<field name="name">Roomstays</field>
|
||||||
<field name="model">exely.roomstays</field>
|
<field name="model">hms.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_exely_roomstays_action" model="ir.actions.act_window">
|
<record id="action_hms_roomstays_action" model="ir.actions.act_window">
|
||||||
<field name="name">Exely Room Stays</field>
|
<field name="name">RoomStays</field>
|
||||||
<field name="res_model">exely.roomstays</field>
|
<field name="res_model">hms.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_exely_roomstays" name="Room Stays" parent="exely_models_root_menu" sequence="70" action="action_exely_roomstays_action"/>
|
<menuitem id="menu_hms_roomstays" name="Room Stays" parent="customers_and_partners_root_menu" groups="base.group_no_one" sequence="70" action="action_hms_roomstays_action"/>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
52
bross_hms/views/status.xml
Normal file
52
bross_hms/views/status.xml
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<?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="40" 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="50" 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/code_projects/odoo18/:/opt/odoo/
|
- /opt/nvme_disk/docker_data/code_server/config/workspace/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/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/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:
|
depends_on:
|
||||||
- odoo
|
- odoo
|
||||||
|
|
||||||
|
|||||||
@ -260,7 +260,7 @@ class ExelyModifiedData(models.Model):
|
|||||||
## break
|
## break
|
||||||
|
|
||||||
def process_exely_data(self):
|
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:
|
if found_booking_record:
|
||||||
max_date = found_booking_record.write_date
|
max_date = found_booking_record.write_date
|
||||||
else:
|
else:
|
||||||
@ -279,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['exely.email'].search([('email', '=', email)], limit=1).id or
|
self.env['hms.email'].search([('email', '=', email)], limit=1).id or
|
||||||
self.env['exely.email'].create({'email': email}).id
|
self.env['hms.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['exely.phones'].search([('phone', '=', phone)], limit=1).id or
|
self.env['hms.phones'].search([('phone', '=', phone)], limit=1).id or
|
||||||
self.env['exely.phones'].create({'phone': phone}).id
|
self.env['hms.phones'].create({'phone': phone}).id
|
||||||
for phone in customer['phones']
|
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:
|
if found_customer:
|
||||||
customer_id = found_customer.id
|
customer_id = found_customer.id
|
||||||
else:
|
else:
|
||||||
customer_id = self.env['exely.customer'].create(customer).id
|
customer_id = self.env['hms.customer'].create(customer).id
|
||||||
data['customer'] = customer_id
|
data['customer'] = customer_id
|
||||||
|
|
||||||
roomstays = data.pop('roomStays', None)
|
roomstays = data.pop('roomStays', None)
|
||||||
@ -304,7 +304,7 @@ class ExelyModifiedData(models.Model):
|
|||||||
roomstay['bid'] = roomstay.pop('id')
|
roomstay['bid'] = roomstay.pop('id')
|
||||||
|
|
||||||
if roomstay.get('roomId', None):
|
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)
|
guests = roomstay.pop('guestsIds', None)
|
||||||
|
|
||||||
@ -317,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['exely.email'].search([('email', '=', email)], limit=1).id or
|
self.env['hms.email'].search([('email', '=', email)], limit=1).id or
|
||||||
self.env['exely.email'].create({'email': email}).id
|
self.env['hms.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['exely.phones'].search([('phone', '=', phone)], limit=1).id or
|
self.env['hms.phones'].search([('phone', '=', phone)], limit=1).id or
|
||||||
self.env['exely.phones'].create({'phone': phone}).id
|
self.env['hms.phones'].create({'phone': phone}).id
|
||||||
for phone in guest_data['phones']
|
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:
|
if found_guest:
|
||||||
guest_id = found_guest.id
|
guest_id = found_guest.id
|
||||||
else:
|
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)
|
guest_ids.append(guest_id)
|
||||||
|
|
||||||
if guest_ids:
|
if guest_ids:
|
||||||
@ -343,21 +343,21 @@ 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['exely.amenities'].search([('name', '=', amenity)])
|
found_amenity = self.env['hms.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['exely.amenities'].create({'name': amenity}).id
|
amenity_id = self.env['hms.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['exely.roomstays'].search([('bid', '=', roomstay['bid'])])
|
found_roomstay = self.env['hms.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['exely.roomstays'].create(roomstay).id
|
roomstay_id = self.env['hms.roomstays'].create(roomstay).id
|
||||||
roomstays_ids.append(roomstay_id)
|
roomstays_ids.append(roomstay_id)
|
||||||
|
|
||||||
if roomstays_ids:
|
if roomstays_ids:
|
||||||
@ -368,7 +368,7 @@ class ExelyModifiedData(models.Model):
|
|||||||
if to_create:
|
if to_create:
|
||||||
for i in to_create:
|
for i in to_create:
|
||||||
try:
|
try:
|
||||||
self.env['exely.bookings'].create(i)
|
self.env['hms.bookings'].create(i)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
_logger.warning(f"##############################: {i}")
|
_logger.warning(f"##############################: {i}")
|
||||||
|
|
||||||
@ -521,9 +521,9 @@ class ExelyModifiedData(models.Model):
|
|||||||
# self.env['exely.bookings'].create(to_create)
|
# self.env['exely.bookings'].create(to_create)
|
||||||
|
|
||||||
|
|
||||||
class ExcelyBookings(models.Model):
|
class HmsBookings(models.Model):
|
||||||
_inherit = 'exely.bookings'
|
_inherit = 'hms.bookings'
|
||||||
_description = 'Exely Bookings'
|
_description = 'Hms 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="Exely Integration" id="exely_integration_submenu" parent="bross_hms.exely_root_menu" sequence="10"/>
|
<menuitem name="HMS Integrations" id="exely_integration_submenu" sequence="20"/>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
27
nbg_exchange_rates/LICENSE
Normal file
27
nbg_exchange_rates/LICENSE
Normal file
@ -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.
|
||||||
1
nbg_exchange_rates/__init__.py
Normal file
1
nbg_exchange_rates/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
from . import models
|
||||||
27
nbg_exchange_rates/__manifest__.py
Normal file
27
nbg_exchange_rates/__manifest__.py
Normal file
@ -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,
|
||||||
|
}
|
||||||
17
nbg_exchange_rates/cron/ir_cron.xml
Normal file
17
nbg_exchange_rates/cron/ir_cron.xml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?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
nbg_exchange_rates/models/__init__.py
Normal file
1
nbg_exchange_rates/models/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
from . import res_currency
|
||||||
45
nbg_exchange_rates/models/res_currency.py
Normal file
45
nbg_exchange_rates/models/res_currency.py
Normal file
@ -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}")
|
||||||
BIN
nbg_exchange_rates/static/description/icon.png
Normal file
BIN
nbg_exchange_rates/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
23
nbg_exchange_rates/static/description/index.html
Normal file
23
nbg_exchange_rates/static/description/index.html
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<!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>
|
||||||
BIN
nbg_exchange_rates/static/description/wallpaper.png
Normal file
BIN
nbg_exchange_rates/static/description/wallpaper.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
Loading…
Reference in New Issue
Block a user