diff --git a/.travis.yml b/.travis.yml
index 582828af2..f72334ccb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -15,7 +15,7 @@ addons:
env:
global:
- - VERSION="11.0" TESTS="0" LINT_CHECK="0" TRANSIFEX="0" UNIT_TEST="0"
+ - VERSION="11.0" TESTS="0" LINT_CHECK="0" TRANSIFEX="0" MAKEPOT="0"
# - TRANSIFEX_USER='transbot@odoo-community.org'
# - secure: "XLhGdCIh86zcqww9qBpnk8Xqsf1Pcgw9SKr7X0KYBHJofHj4Z6Kq/oVFjpZ1LSjadsaABKbwY7h4hvKEpxZwptCv+fNTOKYy7hXFLGYnDeNeWu4zA4LI7TA5uPvyZjZ+g2xc+9dzR/VbfRHNqjvmgiEidxxqLeOnNFZ5CHdOdCw="
matrix:
@@ -27,14 +27,14 @@ env:
install:
- git clone https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools --depth=1
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- - travis_install_nightly
- git clone -b ${VERSION} https://github.com/OCA/web.git ${HOME}/dependencies/web --depth=1
- git clone -b ${VERSION} https://github.com/OCA/partner-contact.git ${HOME}/dependencies/partner-contact --depth=1
- - git clone -b ${VERSION} https://github.com/OCA/account-payment.git ${HOME}/dependencies/account_payment_return --depth=1
+ - git clone -b ${VERSION} https://github.com/OCA/account-payment.git ${HOME}/dependencies/account-payment --depth=1
- git clone -b ${VERSION} https://github.com/OCA/connector.git ${HOME}/dependencies/connector --depth=1
- git clone -b ${VERSION} https://github.com/OCA/queue.git ${HOME}/dependencies/queue --depth=1
- pip install odoorpc
- - pip install cachetools
+ - pip install cachetools>=2.0.1
+ - travis_install_nightly
script:
- travis_wait travis_run_tests
diff --git a/README.md b/README.md
index 356c7bf5f..05087cf15 100644
--- a/README.md
+++ b/README.md
@@ -1,27 +1,18 @@
-# HOOTEL PROJECT MODULES [](https://travis-ci.org/hootel/hootel) [](https://codecov.io/gh/hootel/hootel) 
+# HOOTEL PROJECT MODULES [](https://travis-ci.org/hootel/hootel) [](https://codecov.io/gh/hootel/hootel) 
**IMPORTANT:**
- Set time zone of users that use the calendar
**MODULES:**
- - [x] hotel: Base module (Inspired by the work of SerpentCS Hotel Module)
- - [x] hotel_calendar: Adds calendar for manage hotel reservations and rooms configuration
- - [x] hotel_calendar_wubook: Unify 'hotel_wubook_prototype' and 'hotel_calendar' modules
- - [x] hotel_data_bi: Export reservations data for Revenue to MyDataBI
- - [x] hotel_l10n_es: Procedures for check-in process in Spain
- - [ ] hotel_wubook: NOTHING... the idea is use Odoo Connector
- - [x] hotel_wubook_prototype: Current implementation of Wubook Connector... sync data with wubook.net account.
- - [ ] hotel_node_slave: Configure a node as a slave to serve and get information from a master one
+ - [ ] hotel: Base module (Manage Rooms, Reservations, Services, Customers, Mailing, Invoicing, ...)
+ - [ ] hotel_calendar: Adds calendar for manage hotel reservations and rooms configuration
+ - [ ] hotel_calendar_channel_connector: Unify 'hotel_channel_connector' and 'hotel_calendar' modules
+ - [ ] hotel_channel_connector: Base Channel Connector (Using Odoo Connector)
+ - [ ] hotel_channel_connector_wubook: Wubook API Implementation
+ - [ ] hotel_node_helper: Configure a node as a helper to serve and get information from a master one
- [ ] hotel_node_master: Configure a node as a master
- - [ ] glasof_exporter: Export Odoo data to Glasof xls format
- - [x] hotel_revenue: Export Odoo data for Revenue in xls format
- - [x] cash_daily_report: Export Odoo Payments & Payment Returns to xls format
- - [x] invoice_payments_report: Add payments info in invoices
- - [x] theme_chatter_right: Puts chatter to the right
- - [x] report_qweb_pdf_preview: Adds new report_type to generate pdf and launch preview/print process
- - [x] l10n_es_events_scraper: Gets info about relevant events in Spain
**HOW WORKS?**
- - The idea is... the hotel sell 'virtual rooms' and the customer is assigned to one 'normal room'.
- - The folio have all reservation lines, used services...
+ - The idea is... the hotel sell 'rooms types' and the customer is assigned to one 'real room'.
+ - The folio have all reservation lines, used services, etc..
diff --git a/hotel/wizard/wizard_reservation.xml b/hotel/wizard/wizard_reservation.xml
index a9ff1a9f3..90510cc9e 100644
--- a/hotel/wizard/wizard_reservation.xml
+++ b/hotel/wizard/wizard_reservation.xml
@@ -12,11 +12,11 @@
-
+
-
+
-
+
-
+
-
+
+
+
-
+
-
+
@@ -64,25 +64,25 @@
-
+
+ domain="[('isservice','=',True)]"/>
-
+
-
+
-
@@ -92,7 +92,7 @@
Hotel Reservation Wizard
ir.actions.act_window
hotel.folio.wizard
-
+
form
form
new
diff --git a/hotel_calendar/__manifest__.py b/hotel_calendar/__manifest__.py
index 0e910b00b..f6b698da8 100644
--- a/hotel_calendar/__manifest__.py
+++ b/hotel_calendar/__manifest__.py
@@ -22,14 +22,12 @@
'data': [
'views/general.xml',
'views/actions.xml',
- 'views/res_config_views.xml',
'views/inherited_res_users_views.xml',
'views/inherited_hotel_room_type_views.xml',
'views/inherited_hotel_room_views.xml',
'views/room_pricelist_cached_views.xml',
'views/hotel_reservation_views.xml',
'views/hotel_calendar_management_views.xml',
- 'data/views.xml',
'data/menus.xml',
'data/records.xml',
'security/ir.model.access.csv',
diff --git a/hotel_calendar/data/views.xml b/hotel_calendar/data/views.xml
index 78f51aac4..165508115 100644
--- a/hotel_calendar/data/views.xml
+++ b/hotel_calendar/data/views.xml
@@ -6,7 +6,7 @@
Hotel Calendar
hotel.reservation
-
+
form
@@ -15,7 +15,7 @@
-
+
Hotel Calendar Management
hotel.calendar.management
form
diff --git a/hotel_calendar/models/__init__.py b/hotel_calendar/models/__init__.py
index e5d773b59..ab6021fe4 100644
--- a/hotel_calendar/models/__init__.py
+++ b/hotel_calendar/models/__init__.py
@@ -1,18 +1,17 @@
# Copyright 2018 Alexandre Díaz
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-from . import inherited_hotel_reservation
-from . import inherited_product_pricelist_item
-from . import inherited_res_users
from . import bus_hotel_calendar
from . import room_pricelist_cached
from . import hotel_calendar_management
-from . import res_config
+from . import inherited_hotel_reservation
+from . import inherited_product_pricelist_item
+from . import inherited_res_users
from . import inherited_hotel_room
from . import inherited_hotel_room_type
from . import inherited_hotel_room_type_restriction_item
from . import inherited_hotel_room_type_availability
from . import inherited_product_pricelist
from . import inherited_hotel_folio
-from . import inherited_ir_default
-from . import inherited_ir_actions_act_window_view
-from . import inherited_ir_ui_view
+from . import ir_default
+from . import ir_actions_act_window_view
+from . import ir_ui_view
diff --git a/hotel_calendar/models/bus_hotel_calendar.py b/hotel_calendar/models/bus_hotel_calendar.py
index 9314f95ed..8928cce33 100644
--- a/hotel_calendar/models/bus_hotel_calendar.py
+++ b/hotel_calendar/models/bus_hotel_calendar.py
@@ -113,7 +113,6 @@ class BusHotelCalendar(models.TransientModel):
vals['room_type_id']: {
date_dt.strftime("%d/%m/%Y"): [
vals['avail'],
- vals['no_ota'],
vals['id'],
],
},
diff --git a/hotel_calendar/models/hotel_calendar_management.py b/hotel_calendar/models/hotel_calendar_management.py
index 523162ca7..72c71f54d 100644
--- a/hotel_calendar/models/hotel_calendar_management.py
+++ b/hotel_calendar/models/hotel_calendar_management.py
@@ -40,7 +40,6 @@ class HotelCalendarManagement(models.TransientModel):
avail['date'], avail['date'], room_type_id=room_type.id))
ravail = min(cavail, room_type.total_rooms_count, int(avail['avail']))
vals = {
- 'no_ota': avail['no_ota'],
'avail': ravail,
}
return vals
@@ -170,11 +169,20 @@ class HotelCalendarManagement(models.TransientModel):
})
return json_data
+ @api.model
+ def _generate_avalaibility_data(self, room_type, date, avail):
+ return {
+ 'id': avail and avail.id or False,
+ 'date': avail and avail.date or date,
+ 'avail': avail and avail.avail or room_type.total_rooms_count,
+ }
+
@api.model
def _hcalendar_availability_json_data(self, dfrom, dto):
date_start = fields.Date.from_string(dfrom)
date_end = fields.Date.from_string(dto)
date_diff = abs((date_end - date_start).days) + 1
+ hotel_room_type_avail_obj = self.env['hotel.room.type.availability']
room_types = self.env['hotel.room.type'].search([])
json_data = {}
@@ -183,24 +191,12 @@ class HotelCalendarManagement(models.TransientModel):
for i in range(0, date_diff):
cur_date = date_start + timedelta(days=i)
cur_date_str = cur_date.strftime(DEFAULT_SERVER_DATE_FORMAT)
- avail = self.env['hotel.room.type.availability'].search([
+ avail = hotel_room_type_avail_obj.search([
('date', '=', cur_date_str),
('room_type_id', '=', room_type.id)
])
- if avail:
- json_data[room_type.id].append({
- 'id': avail.id,
- 'date': avail.date,
- 'avail': avail.avail,
- 'no_ota': avail.no_ota,
- })
- else:
- json_data[room_type.id].append({
- 'id': False,
- 'date': cur_date_str,
- 'avail': room_type.total_rooms_count,
- 'no_ota': False,
- })
+ json_data[room_type.id].append(
+ self._generate_avalaibility_data(room_type, cur_date_str, avail))
return json_data
@api.model
diff --git a/hotel_calendar/models/inherited_hotel_room_type_availability.py b/hotel_calendar/models/inherited_hotel_room_type_availability.py
index 4a001c4a9..edca3a8e8 100644
--- a/hotel_calendar/models/inherited_hotel_room_type_availability.py
+++ b/hotel_calendar/models/inherited_hotel_room_type_availability.py
@@ -6,16 +6,20 @@ from odoo import models, fields, api
class HotelRoomTypeAvailability(models.Model):
_inherit = 'hotel.room.type.availability'
+ def _prepare_notif_values(self, record):
+ return {
+ 'date': record.date,
+ 'avail': record.avail,
+ 'room_type_id': record.room_type_id.id,
+ 'id': record.id,
+ }
+
@api.model
def create(self, vals):
res = super(HotelRoomTypeAvailability, self).create(vals)
- self.env['bus.hotel.calendar'].send_availability_notification({
- 'date': res.date,
- 'avail': res.avail,
- 'no_ota': res.no_ota,
- 'room_type_id': res.room_type_id.id,
- 'id': res.id,
- })
+ self.env['bus.hotel.calendar'].send_availability_notification(
+ self._prepare_notif_values(res)
+ )
return res
@api.multi
@@ -23,13 +27,9 @@ class HotelRoomTypeAvailability(models.Model):
ret_vals = super(HotelRoomTypeAvailability, self).write(vals)
bus_hotel_calendar_obj = self.env['bus.hotel.calendar']
for record in self:
- bus_hotel_calendar_obj.send_availability_notification({
- 'date': record.date,
- 'avail': record.avail,
- 'no_ota': record.no_ota,
- 'room_type_id': record.room_type_id.id,
- 'id': record.id,
- })
+ bus_hotel_calendar_obj.send_availability_notification(
+ self._prepare_notif_values(record)
+ )
return ret_vals
@api.multi
@@ -37,13 +37,9 @@ class HotelRoomTypeAvailability(models.Model):
# Construct dictionary with relevant info of removed records
unlink_vals = []
for record in self:
- unlink_vals.append({
- 'date': record.date,
- 'avail': record.room_type_id.total_rooms_count,
- 'room_type_id': record.room_type_id.id,
- 'no_ota': False,
- 'id': record.id,
- })
+ unlink_vals.append(
+ self._prepare_notif_values(record)
+ )
res = super(HotelRoomTypeAvailability, self).unlink()
bus_hotel_calendar_obj = self.env['bus.hotel.calendar']
for uval in unlink_vals:
diff --git a/hotel_calendar/models/inherited_res_users.py b/hotel_calendar/models/inherited_res_users.py
index 63d7d98d2..078c51ab0 100644
--- a/hotel_calendar/models/inherited_res_users.py
+++ b/hotel_calendar/models/inherited_res_users.py
@@ -80,3 +80,112 @@ class ResUsers(models.Model):
npms_denied_events_tags = fields.Many2many(
'calendar.event.type',
string="Deny Calander Event Tags")
+
+ color_pre_reservation = fields.Char('Pre-reservation', default='#A4A4A4')
+ color_reservation = fields.Char('Confirmed Reservation ', default='#4E9DC4')
+ color_reservation_pay = fields.Char('Paid Reservation', default='#66CCFF')
+ color_stay = fields.Char('Checkin', default='#b40606')
+ color_stay_pay = fields.Char('Paid Checkin', default='#54d12b')
+ color_checkout = fields.Char('Checkout', default='#FF0000')
+ color_dontsell = fields.Char('Dont Sell', default='#000000')
+ color_staff = fields.Char('Staff', default='#FF9933')
+ color_to_assign = fields.Char('Ota Reservation to Assign', default='#DFFF00')
+ color_payment_pending = fields.Char('Payment Pending', default='#f70f0f')
+
+ color_letter_pre_reservation = fields.Char('Letter Pre-reservation', default='#000000')
+ color_letter_reservation = fields.Char('Letter Confirmed Reservation ', default='#000000')
+ color_letter_reservation_pay = fields.Char('Letter Paid Reservation', default='#000000')
+ color_letter_stay = fields.Char('Letter Checkin', default='#FFFFFF')
+ color_letter_stay_pay = fields.Char('Letter Stay Pay', default='#000000')
+ color_letter_checkout = fields.Char('Letter Checkout', default='#FFFFFF')
+ color_letter_dontsell = fields.Char('Letter Dont Sell', default='#FFFFFF')
+ color_letter_staff = fields.Char('Letter Staff', default='#000000')
+ color_letter_to_assign = fields.Char('Letter Ota to Assign', default='#000000')
+ color_letter_payment_pending = fields.Char('Letter Payment Pending', default='#000000')
+
+ def __init__(self, pool, cr):
+ """ Override of __init__ to add access rights.
+ Access rights are disabled by default, but allowed on some specific
+ fields defined in self.SELF_{READ/WRITE}ABLE_FIELDS.
+ """
+ super(ResUsers, self).__init__(pool, cr)
+ # duplicate list to avoid modifying the original reference
+ type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS)
+ type(self).SELF_WRITEABLE_FIELDS.extend([
+ 'pms_divide_rooms_by_capacity',
+ 'pms_end_day_week',
+ 'pms_end_day_week_offset',
+ 'pms_type_move',
+ 'pms_default_num_days',
+ 'pms_show_notifications',
+ 'pms_show_pricelist',
+ 'pms_show_availability',
+ 'pms_show_num_rooms',
+ 'pms_allowed_events_tags',
+ 'pms_denied_events_tags',
+ 'npms_end_day_week',
+ 'npms_end_day_week_offset',
+ 'npms_default_num_days',
+ 'npms_allowed_events_tags',
+ 'npms_denied_events_tags',
+ 'color_pre_reservation',
+ 'color_reservation',
+ 'color_reservation_pay',
+ 'color_stay',
+ 'color_stay_pay',
+ 'color_checkout',
+ 'color_dontsell',
+ 'color_staff',
+ 'color_to_assign',
+ 'color_payment_pending',
+ 'color_letter_pre_reservation',
+ 'color_letter_reservation',
+ 'color_letter_reservation_pay',
+ 'color_letter_stay',
+ 'color_letter_stay_pay',
+ 'color_letter_checkout',
+ 'color_letter_dontsell',
+ 'color_letter_staff',
+ 'color_letter_to_assign',
+ 'color_letter_payment_pending',
+ ])
+ # duplicate list to avoid modifying the original reference
+ type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS)
+ type(self).SELF_READABLE_FIELDS.extend([
+ 'pms_divide_rooms_by_capacity',
+ 'pms_end_day_week',
+ 'pms_end_day_week_offset',
+ 'pms_type_move',
+ 'pms_default_num_days',
+ 'pms_show_notifications',
+ 'pms_show_pricelist',
+ 'pms_show_availability',
+ 'pms_show_num_rooms',
+ 'pms_allowed_events_tags',
+ 'pms_denied_events_tags',
+ 'npms_end_day_week',
+ 'npms_end_day_week_offset',
+ 'npms_default_num_days',
+ 'npms_allowed_events_tags',
+ 'npms_denied_events_tags',
+ 'color_pre_reservation',
+ 'color_reservation',
+ 'color_reservation_pay',
+ 'color_stay',
+ 'color_stay_pay',
+ 'color_checkout',
+ 'color_dontsell',
+ 'color_staff',
+ 'color_to_assign',
+ 'color_payment_pending',
+ 'color_letter_pre_reservation',
+ 'color_letter_reservation',
+ 'color_letter_reservation_pay',
+ 'color_letter_stay',
+ 'color_letter_stay_pay',
+ 'color_letter_checkout',
+ 'color_letter_dontsell',
+ 'color_letter_staff',
+ 'color_letter_to_assign',
+ 'color_letter_payment_pending',
+ ])
diff --git a/hotel_calendar/models/inherited_ir_actions_act_window_view.py b/hotel_calendar/models/ir_actions_act_window_view.py
similarity index 100%
rename from hotel_calendar/models/inherited_ir_actions_act_window_view.py
rename to hotel_calendar/models/ir_actions_act_window_view.py
diff --git a/hotel_calendar/models/inherited_ir_default.py b/hotel_calendar/models/ir_default.py
similarity index 100%
rename from hotel_calendar/models/inherited_ir_default.py
rename to hotel_calendar/models/ir_default.py
diff --git a/hotel_calendar/models/inherited_ir_ui_view.py b/hotel_calendar/models/ir_ui_view.py
similarity index 100%
rename from hotel_calendar/models/inherited_ir_ui_view.py
rename to hotel_calendar/models/ir_ui_view.py
diff --git a/hotel_calendar/models/res_config.py b/hotel_calendar/models/res_config.py
deleted file mode 100644
index 9948dfd56..000000000
--- a/hotel_calendar/models/res_config.py
+++ /dev/null
@@ -1,165 +0,0 @@
-# Copyright 2018 Alexandre Díaz
-# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-from odoo import models, fields, api
-
-
-class HotelConfiguration(models.TransientModel):
- _inherit = 'res.config.settings'
-
- color_pre_reservation = fields.Char('Pre-reservation')
- color_reservation = fields.Char('Confirmed Reservation')
- color_reservation_pay = fields.Char('Paid Reservation')
- color_stay = fields.Char('Checkin')
- color_stay_pay = fields.Char('Paid Checkin')
- color_checkout = fields.Char('Checkout')
- color_dontsell = fields.Char('Dont Sell')
- color_staff = fields.Char('Staff')
- color_to_assign = fields.Char('Ota Reservation to Assign')
- color_payment_pending = fields.Char('Letter Payment Pending')
- color_letter_pre_reservation = fields.Char('Letter Pre-reservation')
- color_letter_reservation = fields.Char('Letter Confirmed Reservation')
- color_letter_reservation_pay = fields.Char('Letter Paid Reservation')
- color_letter_stay = fields.Char('Letter Checkin')
- color_letter_stay_pay = fields.Char('Letter Stay Pay')
- color_letter_checkout = fields.Char('Letter Checkout')
- color_letter_dontsell = fields.Char('Letter Dont Sell')
- color_letter_staff = fields.Char('Letter Staff')
- color_letter_to_assign = fields.Char('Letter Ota to Assign')
- color_letter_payment_pending = fields.Char('Letter Payment Pending')
-
- @api.multi
- def set_values(self):
- super(HotelConfiguration, self).set_values()
- self.env['ir.default'].sudo().set(
- 'res.config.settings',
- 'color_pre_reservation', self.color_pre_reservation)
- self.env['ir.default'].sudo().set(
- 'res.config.settings',
- 'color_reservation', self.color_reservation)
- self.env['ir.default'].sudo().set(
- 'res.config.settings',
- 'color_reservation_pay', self.color_reservation_pay)
- self.env['ir.default'].sudo().set(
- 'res.config.settings', 'color_stay', self.color_stay)
- self.env['ir.default'].sudo().set(
- 'res.config.settings', 'color_stay_pay', self.color_stay_pay)
- self.env['ir.default'].sudo().set(
- 'res.config.settings', 'color_checkout', self.color_checkout)
- self.env['ir.default'].sudo().set(
- 'res.config.settings', 'color_dontsell', self.color_dontsell)
- self.env['ir.default'].sudo().set(
- 'res.config.settings', 'color_staff', self.color_staff)
- self.env['ir.default'].sudo().set(
- 'res.config.settings', 'color_to_assign', self.color_to_assign)
- self.env['ir.default'].sudo().set(
- 'res.config.settings',
- 'color_payment_pending', self.color_payment_pending)
- self.env['ir.default'].sudo().set(
- 'res.config.settings',
- 'color_letter_pre_reservation', self.color_letter_pre_reservation)
- self.env['ir.default'].sudo().set(
- 'res.config.settings',
- 'color_letter_reservation', self.color_letter_reservation)
- self.env['ir.default'].sudo().set(
- 'res.config.settings',
- 'color_letter_reservation_pay', self.color_letter_reservation_pay)
- self.env['ir.default'].sudo().set(
- 'res.config.settings', 'color_letter_stay', self.color_letter_stay)
- self.env['ir.default'].sudo().set(
- 'res.config.settings', 'color_letter_stay_pay', self.color_letter_stay_pay)
- self.env['ir.default'].sudo().set(
- 'res.config.settings', 'color_letter_checkout', self.color_letter_checkout)
- self.env['ir.default'].sudo().set(
- 'res.config.settings', 'color_letter_dontsell', self.color_letter_dontsell)
- self.env['ir.default'].sudo().set(
- 'res.config.settings', 'color_letter_staff', self.color_letter_staff)
- self.env['ir.default'].sudo().set(
- 'res.config.settings', 'color_letter_to_assign', self.color_letter_to_assign)
- self.env['ir.default'].sudo().set(
- 'res.config.settings',
- 'color_letter_payment_pending', self.color_letter_payment_pending)
- self.env['ir.default'].sudo().set(
- 'res.config.settings',
- 'default_arrival_hour', self.default_arrival_hour)
-
- @api.model
- def get_values(self):
- res = super(HotelConfiguration, self).get_values()
-
- # ONLY FOR v11. DO NOT FORWARD-PORT
- color_pre_reservation = self.env['ir.default'].sudo().get(
- 'res.config.settings',
- 'color_pre_reservation', self.color_pre_reservation)
- color_reservation = self.env['ir.default'].sudo().get(
- 'res.config.settings',
- 'color_reservation', self.color_reservation)
- color_reservation_pay = self.env['ir.default'].sudo().get(
- 'res.config.settings',
- 'color_reservation_pay', self.color_reservation_pay)
- color_stay = self.env['ir.default'].sudo().get(
- 'res.config.settings', 'color_stay', self.color_stay)
- color_stay_pay = self.env['ir.default'].sudo().get(
- 'res.config.settings', 'color_stay_pay', self.color_stay_pay)
- color_checkout = self.env['ir.default'].sudo().get(
- 'res.config.settings', 'color_checkout', self.color_checkout)
- color_dontsell = self.env['ir.default'].sudo().get(
- 'res.config.settings', 'color_dontsell', self.color_dontsell)
- color_staff = self.env['ir.default'].sudo().get(
- 'res.config.settings', 'color_staff', self.color_staff)
- color_to_assign = self.env['ir.default'].sudo().get(
- 'res.config.settings', 'color_to_assign', self.color_to_assign)
- color_payment_pending = self.env['ir.default'].sudo().get(
- 'res.config.settings',
- 'color_payment_pending', self.color_payment_pending)
- color_letter_pre_reservation = self.env['ir.default'].sudo().get(
- 'res.config.settings',
- 'color_letter_pre_reservation', self.color_letter_pre_reservation)
- color_letter_reservation = self.env['ir.default'].sudo().get(
- 'res.config.settings',
- 'color_letter_reservation', self.color_letter_reservation)
- color_letter_reservation_pay = self.env['ir.default'].sudo().get(
- 'res.config.settings',
- 'color_letter_reservation_pay', self.color_letter_reservation_pay)
- color_letter_stay = self.env['ir.default'].sudo().get(
- 'res.config.settings', 'color_letter_stay', self.color_letter_stay)
- color_letter_stay_pay = self.env['ir.default'].sudo().get(
- 'res.config.settings', 'color_letter_stay_pay',
- self.color_letter_stay_pay)
- color_letter_checkout = self.env['ir.default'].sudo().get(
- 'res.config.settings', 'color_letter_checkout',
- self.color_letter_checkout)
- color_letter_dontsell = self.env['ir.default'].sudo().get(
- 'res.config.settings', 'color_letter_dontsell',
- self.color_letter_dontsell)
- color_letter_staff = self.env['ir.default'].sudo().get(
- 'res.config.settings', 'color_letter_staff',
- self.color_letter_staff)
- color_letter_to_assign = self.env['ir.default'].sudo().get(
- 'res.config.settings', 'color_letter_to_assign',
- self.color_letter_to_assign)
- color_letter_payment_pending = self.env['ir.default'].sudo().get(
- 'res.config.settings',
- 'color_letter_payment_pending', self.color_letter_payment_pending)
- res.update(
- color_pre_reservation=color_pre_reservation,
- color_reservation=color_reservation,
- color_reservation_pay=color_reservation_pay,
- color_stay=color_stay,
- color_stay_pay=color_stay_pay,
- color_checkout=color_checkout,
- color_dontsell=color_dontsell,
- color_staff=color_staff,
- color_to_assign=color_to_assign,
- color_payment_pending=color_payment_pending,
- color_letter_pre_reservation=color_letter_pre_reservation,
- color_letter_reservation=color_letter_reservation,
- color_letter_reservation_pay=color_letter_reservation_pay,
- color_letter_stay=color_letter_stay,
- color_letter_stay_pay=color_letter_stay_pay,
- color_letter_checkout=color_letter_checkout,
- color_letter_dontsell=color_letter_dontsell,
- color_letter_staff=color_letter_staff,
- color_letter_to_assign=color_letter_to_assign,
- color_letter_payment_pending=color_letter_payment_pending,
- )
- return res
diff --git a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js
index 547d1d1b1..9706abd13 100644
--- a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js
+++ b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_controller.js
@@ -221,8 +221,8 @@ var PMSCalendarController = AbstractController.extend({
_onUpdateButtonsCounter: function (ev) {
var self = this;
- var domain_checkouts = [['is_checkout', '=', true]];
- var domain_checkins = [['is_checkin', '=', true]];
+ var domain_checkouts = [['checkout', '=', moment().format(HotelConstants.ODOO_DATETIME_MOMENT_FORMAT)]];
+ var domain_checkins = [['checkin', '=', moment().format(HotelConstants.ODOO_DATETIME_MOMENT_FORMAT)]];
var domain_overbookings = [['overbooking', '=', true], ['state', 'not in', ['cancelled']]];
$.when(
this.model.search_count(domain_checkouts),
diff --git a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_model.js b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_model.js
index 43f98007a..f92c09774 100644
--- a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_model.js
+++ b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_model.js
@@ -73,7 +73,7 @@ return AbstractModel.extend({
},
get_amenities: function() {
return this._rpc({
- model: 'hotel.room.amenities',
+ model: 'hotel.amenity',
method: 'search_read',
args: [false, ['id','name']],
context: Session.user_context,
diff --git a/hotel_calendar/tests/__init__.py b/hotel_calendar/tests/__init__.py
index 40a96afc6..c9580b6f0 100644
--- a/hotel_calendar/tests/__init__.py
+++ b/hotel_calendar/tests/__init__.py
@@ -1 +1,2 @@
-# -*- coding: utf-8 -*-
+# Copyright 2018 Alexandre Díaz
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
diff --git a/hotel_calendar/views/actions.xml b/hotel_calendar/views/actions.xml
index 0f82b63e2..a60864446 100644
--- a/hotel_calendar/views/actions.xml
+++ b/hotel_calendar/views/actions.xml
@@ -6,7 +6,7 @@
hotel.reservation
form
tree,form
- [('is_checkin','=', True)]
+ [('checkin','=', datetime.datetime.now().strftime('%Y-%m-%d'))]
@@ -14,7 +14,7 @@
hotel.reservation
form
tree,form
- [('is_checkout','=', True)]
+ [('checkout','=', datetime.datetime.now().strftime('%Y-%m-%d'))]
diff --git a/hotel_calendar/views/hotel_calendar_management_views.xml b/hotel_calendar/views/hotel_calendar_management_views.xml
index da3c3aef3..6d12c3abb 100644
--- a/hotel_calendar/views/hotel_calendar_management_views.xml
+++ b/hotel_calendar/views/hotel_calendar_management_views.xml
@@ -1,7 +1,7 @@
-
+
hotel.calendar.management.mpms
hotel.calendar.management
diff --git a/hotel_calendar/views/hotel_reservation_views.xml b/hotel_calendar/views/hotel_reservation_views.xml
index f07778c81..6c32e0a8b 100644
--- a/hotel_calendar/views/hotel_reservation_views.xml
+++ b/hotel_calendar/views/hotel_reservation_views.xml
@@ -1,7 +1,7 @@
-
+
hotel.reservation.pms
hotel.reservation
diff --git a/hotel_calendar/views/inherited_hotel_room_type_views.xml b/hotel_calendar/views/inherited_hotel_room_type_views.xml
index e508524a3..9726a0d71 100644
--- a/hotel_calendar/views/inherited_hotel_room_type_views.xml
+++ b/hotel_calendar/views/inherited_hotel_room_type_views.xml
@@ -3,7 +3,7 @@
hotel.room.type
-
+
diff --git a/hotel_calendar/views/inherited_hotel_room_views.xml b/hotel_calendar/views/inherited_hotel_room_views.xml
index c0198d112..3d84684cb 100644
--- a/hotel_calendar/views/inherited_hotel_room_views.xml
+++ b/hotel_calendar/views/inherited_hotel_room_views.xml
@@ -1,9 +1,9 @@
-
+
hotel.room
-
+
diff --git a/hotel_calendar/views/inherited_res_users_views.xml b/hotel_calendar/views/inherited_res_users_views.xml
index 0d94cd57a..c62e4042c 100644
--- a/hotel_calendar/views/inherited_res_users_views.xml
+++ b/hotel_calendar/views/inherited_res_users_views.xml
@@ -1,7 +1,7 @@
-
+
res.users
@@ -36,6 +36,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hotel_calendar/views/res_config_views.xml b/hotel_calendar/views/res_config_views.xml
deleted file mode 100644
index 0047838ad..000000000
--- a/hotel_calendar/views/res_config_views.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
- res.config.settings.view.form.inherit.hotel
- res.config.settings
-
-
-
-
- Calendar colors
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/hotel_calendar/views/room_pricelist_cached_views.xml b/hotel_calendar/views/room_pricelist_cached_views.xml
index 0ed327c7c..9ff9d3348 100644
--- a/hotel_calendar/views/room_pricelist_cached_views.xml
+++ b/hotel_calendar/views/room_pricelist_cached_views.xml
@@ -2,7 +2,7 @@
-
+
hotel.room.pricelist.cached.form
room.pricelist.cached
@@ -19,7 +19,7 @@
-
+
hotel.room.pricelist.cached.tree
room.pricelist.cached
diff --git a/hotel_calendar_channel_connector/__manifest__.py b/hotel_calendar_channel_connector/__manifest__.py
index a9a707498..619129398 100644
--- a/hotel_calendar_channel_connector/__manifest__.py
+++ b/hotel_calendar_channel_connector/__manifest__.py
@@ -21,16 +21,16 @@
##############################################################################
{
- 'name': 'Hotel Calendar WuBook',
+ 'name': 'Hotel Calendar Channel Connector',
'version': '1.0',
- 'author': "Alexandre Díaz (Aloxa Solucións S.L.) ",
- 'website': 'https://www.eiqui.com',
+ 'author': "Alexandre Díaz ",
+ 'website': 'https://github.com/hootel/hootel',
'category': 'eiqui/hotel',
- 'summary': "Hotel Calendar",
- 'description': "Hotel Calendar WuBook",
+ 'summary': "Hotel Calendar Channel Connector",
+ 'description': "Unify 'hotel_calendar' and 'hotel_channel_connector'",
'depends': [
'hotel_calendar',
- 'hotel_wubook_proto',
+ 'hotel_channel_connector',
],
'external_dependencies': {
'python': []
diff --git a/hotel_calendar_channel_connector/models/inherited_bus_hotel_calendar.py b/hotel_calendar_channel_connector/models/inherited_bus_hotel_calendar.py
index f3bc09eac..940fdc5fc 100644
--- a/hotel_calendar_channel_connector/models/inherited_bus_hotel_calendar.py
+++ b/hotel_calendar_channel_connector/models/inherited_bus_hotel_calendar.py
@@ -1,8 +1,8 @@
# Copyright 2018 Alexandre Díaz
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from datetime import datetime
-from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
-from openerp import models, api
+from odoo.tools import DEFAULT_SERVER_DATE_FORMAT
+from odoo import models, api
from odoo.addons.hotel_calendar.controllers.bus import HOTEL_BUS_CHANNEL_ID
@@ -30,15 +30,21 @@ class BusHotelCalendar(models.TransientModel):
def _generate_reservation_notif(self, vals):
json = super(BusHotelCalendar, self)._generate_reservation_notif(vals)
json['reservation'].update({
- 'wrid': vals['wrid'],
+ 'external_id': vals['external_id'],
})
return json
@api.model
- def send_issue_notification(self, ntype, title, issue_id, section,
- message):
- notif = self._generate_issue_notification(ntype, title, issue_id,
- section, message)
+ def _generate_availability_notification(self, vals):
+ date_dt = datetime.strptime(vals['date'], DEFAULT_SERVER_DATE_FORMAT)
+ json = super(BusHotelCalendar, self)._generate_availability_notification(vals)
+ json['availability'][vals['room_type_id']][date_dt.strftime("%d/%m/%Y")].append(
+ vals['no_ota'])
+ return json
+
+ @api.model
+ def send_issue_notification(self, ntype, title, issue_id, section, message):
+ notif = self._generate_issue_notification(ntype, title, issue_id, section, message)
self.env['bus.bus'].sendone(
- (self._cr.dbname, 'hotel.reservation',
- HOTEL_BUS_CHANNEL_ID), notif)
+ (self._cr.dbname, 'hotel.reservation',
+ HOTEL_BUS_CHANNEL_ID), notif)
diff --git a/hotel_calendar_channel_connector/models/inherited_hotel_calendar_management.py b/hotel_calendar_channel_connector/models/inherited_hotel_calendar_management.py
index 969076aa9..28eeab040 100644
--- a/hotel_calendar_channel_connector/models/inherited_hotel_calendar_management.py
+++ b/hotel_calendar_channel_connector/models/inherited_hotel_calendar_management.py
@@ -1,6 +1,6 @@
# Copyright 2018 Alexandre Díaz
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-from openerp import models, api
+from odoo import models, api
class HotelCalendarManagement(models.TransientModel):
@@ -10,7 +10,19 @@ class HotelCalendarManagement(models.TransientModel):
def _get_availability_values(self, avail, room_type):
vals = super(HotelCalendarManagement, self)._get_availability_values(
avail, room_type)
- vals.update({'wmax_avail': vals['avail']})
+ vals.update({
+ 'channel_max_avail': vals['avail'],
+ 'no_ota': avail['no_ota'],
+ })
+ return vals
+
+ @api.model
+ def _generate_avalaibility_data(self, room_type, date, avail):
+ vals = super(HotelCalendarManagement, self)._generate_avalaibility_data(
+ room_type, date, avail)
+ vals.update({
+ 'no_ota': avail and avail.no_ota or False,
+ })
return vals
@api.multi
diff --git a/hotel_calendar_channel_connector/models/inherited_hotel_channel_connector_issue.py b/hotel_calendar_channel_connector/models/inherited_hotel_channel_connector_issue.py
index bbaa6d821..37be839a6 100644
--- a/hotel_calendar_channel_connector/models/inherited_hotel_channel_connector_issue.py
+++ b/hotel_calendar_channel_connector/models/inherited_hotel_channel_connector_issue.py
@@ -1,14 +1,14 @@
# Copyright 2018 Alexandre Díaz
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-from openerp import models, fields, api, _
+from odoo import models, fields, api, _
-class WuBookIssue(models.Model):
+class HotelChannelConnectorIssue(models.Model):
_inherit = 'hotel.channel.connector.issue'
@api.model
def create(self, vals):
- issue_id = super(WuBookIssue, self).create(vals)
+ issue_id = super(HotelChannelConnectorIssue, self).create(vals)
self.env['bus.hotel.calendar'].send_issue_notification(
'warn',
_("Oops! Issue Reported!!"),
diff --git a/hotel_calendar_channel_connector/models/inherited_hotel_reservation.py b/hotel_calendar_channel_connector/models/inherited_hotel_reservation.py
index 30bc6e20e..fd7435e58 100644
--- a/hotel_calendar_channel_connector/models/inherited_hotel_reservation.py
+++ b/hotel_calendar_channel_connector/models/inherited_hotel_reservation.py
@@ -2,8 +2,8 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
from datetime import datetime, timedelta
-from openerp import models, fields, api, _
-from openerp.tools import (
+from odoo import models, fields, api, _
+from odoo.tools import (
DEFAULT_SERVER_DATE_FORMAT,
DEFAULT_SERVER_DATETIME_FORMAT)
_logger = logging.getLogger(__name__)
@@ -27,15 +27,17 @@ class HotelReservation(models.Model):
room_name, partner_phone, state, fix_days)
reserv = self.env['hotel.reservation'].browse(vals['reserv_id'])
vals['reservation'].update({
- 'fix_days': (reserv.wrid and reserv.wrid != '') or fix_days,
- 'wchannel': (reserv.wchannel_id and reserv.wchannel_id.name),
+ 'fix_days': (any(reserv.channel_bind_ids) and
+ reserv.channel_bind_ids[0].external_id) or fix_days,
+ 'ota_id': (any(reserv.channel_bind_ids) and
+ reserv.channel_bind_ids[0].ota_id and
+ reserv.channel_bind_ids[0].ota_id.name),
})
return vals
@api.multi
def _hcalendar_reservation_data(self, reservations):
- vals = super(HotelReservation, self)._hcalendar_reservation_data(
- reservations)
+ vals = super(HotelReservation, self)._hcalendar_reservation_data(reservations)
hotel_reservation_obj = self.env['hotel.reservation']
json_reservations = []
for v_rval in vals[0]:
@@ -56,12 +58,16 @@ class HotelReservation(models.Model):
# Read-Only
False,
# Fix Days
- (reserv.wrid and reserv.wrid != '') or reserv.splitted,
+ (any(reserv.channel_bind_ids) and
+ reserv.channel_bind_ids[0].external_id) or reserv.splitted,
# Fix Rooms
False,
reserv.overbooking))
# Update tooltips
- vals[1][reserv.id].append(reserv.wchannel_id.name)
+ if any(reserv.channel_bind_ids):
+ vals[1][reserv.id].append(reserv.channel_bind_ids[0].ota_id.name)
+ else:
+ vals[1][reserv.id].append(False)
return (json_reservations, vals[1])
@api.multi
@@ -92,7 +98,8 @@ class HotelReservation(models.Model):
'fix_days': record.splitted or record.is_from_ota,
'overbooking': record.overbooking,
'price': record.folio_id.amount_total,
- 'wrid': record.wrid,
+ 'external_id': (any(record.channel_bind_ids) and
+ record.channel_bind_ids[0].external_id),
})
@api.multi
diff --git a/hotel_calendar_channel_connector/models/inherited_wubook_issue.py b/hotel_calendar_channel_connector/models/inherited_wubook_issue.py
deleted file mode 100644
index a897e3ac0..000000000
--- a/hotel_calendar_channel_connector/models/inherited_wubook_issue.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2017 Solucións Aloxa S.L.
-# Alexandre Díaz
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-from openerp import models, fields, api, _
-
-
-class WuBookIssue(models.Model):
- _inherit = 'wubook.issue'
-
- @api.model
- def create(self, vals):
- issue_id = super(WuBookIssue, self).create(vals)
- self.env['bus.hotel.calendar'].send_issue_notification(
- 'warn',
- _("Oops! Issue Reported!!"),
- issue_id.id,
- issue_id.section,
- issue_id.message)
- return issue_id
diff --git a/hotel_calendar_channel_connector/tests/__init__.py b/hotel_calendar_channel_connector/tests/__init__.py
index 5c2388c95..9920f3f1e 100644
--- a/hotel_calendar_channel_connector/tests/__init__.py
+++ b/hotel_calendar_channel_connector/tests/__init__.py
@@ -1,3 +1,3 @@
# Copyright 2018 Alexandre Díaz
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-from . import test_folio
+#from . import test_folio
diff --git a/hotel_calendar_channel_connector/views/hotel_reservation.xml b/hotel_calendar_channel_connector/views/hotel_reservation.xml
index 981f0ba31..42011bdef 100644
--- a/hotel_calendar_channel_connector/views/hotel_reservation.xml
+++ b/hotel_calendar_channel_connector/views/hotel_reservation.xml
@@ -3,7 +3,7 @@
-
+
hotel.toassign.reservation.tree
hotel.reservation
@@ -68,7 +68,7 @@
hotel.reservation
-
+