diff --git a/hotel_calendar/__manifest__.py b/hotel_calendar/__manifest__.py index 1af70e996..9c977338a 100644 --- a/hotel_calendar/__manifest__.py +++ b/hotel_calendar/__manifest__.py @@ -27,6 +27,8 @@ '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', diff --git a/hotel_calendar/data/menus.xml b/hotel_calendar/data/menus.xml index 9a8ac6ed1..72beee4bd 100644 --- a/hotel_calendar/data/menus.xml +++ b/hotel_calendar/data/menus.xml @@ -5,6 +5,7 @@ Hotel Calendar hotel.reservation pms + form @@ -21,7 +22,7 @@ web_icon="hotel_calendar,static/description/icon_calendar_configurator.png" action="action_hotel_calendar_management" groups="hotel.group_hotel_manager" /> - + diff --git a/hotel_calendar/models/inherited_ir_actions_act_window_view.py b/hotel_calendar/models/inherited_ir_actions_act_window_view.py index e416d6664..4a622268e 100644 --- a/hotel_calendar/models/inherited_ir_actions_act_window_view.py +++ b/hotel_calendar/models/inherited_ir_actions_act_window_view.py @@ -5,4 +5,4 @@ from odoo import models, fields class ActWindowView(models.Model): _inherit = 'ir.actions.act_window.view' - view_mode = fields.Selection(selection_add=[('pms', "PMS")]) + view_mode = fields.Selection(selection_add=[('pms', "PMS"), ('mpms', 'Management PMS')]) diff --git a/hotel_calendar/models/inherited_ir_ui_view.py b/hotel_calendar/models/inherited_ir_ui_view.py index 2491feda5..e5e526341 100644 --- a/hotel_calendar/models/inherited_ir_ui_view.py +++ b/hotel_calendar/models/inherited_ir_ui_view.py @@ -5,4 +5,4 @@ from odoo import models, fields class View(models.Model): _inherit = 'ir.ui.view' - type = fields.Selection(selection_add=[('pms', "PMS")]) + type = fields.Selection(selection_add=[('pms', "PMS"), ('mpms', 'Management PMS')]) diff --git a/hotel_calendar/security/ir.model.access.csv b/hotel_calendar/security/ir.model.access.csv index eb1e32c43..95627661a 100644 --- a/hotel_calendar/security/ir.model.access.csv +++ b/hotel_calendar/security/ir.model.access.csv @@ -1,5 +1,5 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_virtual_price_cache_user,hotel_calendar.model_virtual_room_pricelist_cached_user,hotel_calendar.model_virtual_room_pricelist_cached,hotel.group_hotel_user,1,1,1,1 -access_virtual_price_cache_call,hotel_calendar.model_virtual_room_pricelist_cached_call,hotel_calendar.model_virtual_room_pricelist_cached,hotel.group_hotel_call,1,1,1,1 +access_room_price_cache_user,hotel_calendar.model_room_pricelist_cached_user,hotel_calendar.model_room_pricelist_cached,hotel.group_hotel_user,1,1,1,1 +access_room_price_cache_call,hotel_calendar.model_room_pricelist_cached_call,hotel_calendar.model_room_pricelist_cached,hotel.group_hotel_call,1,1,1,1 access_hotel_product_pricelist_item_call,hotel_calendar.pricelist_item_call,hotel_calendar.model_product_pricelist_item,hotel.group_hotel_call,1,1,1,1 access_hotel_product_pricelist_item_user,hotel_calendar.pricelist_item_use,hotel_calendar.model_product_pricelist_item,hotel.group_hotel_user,1,1,1,1 diff --git a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_view.js b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_view.js index cc863f29f..31f927e28 100644 --- a/hotel_calendar/static/src/js/views/calendar/hotel_calendar_view.js +++ b/hotel_calendar/static/src/js/views/calendar/hotel_calendar_view.js @@ -205,6 +205,7 @@ var PMSCalendarView = AbstractView.extend({ SystrayMenu.Items.push(CalendarMenu); ViewRegistry.add('pms', PMSCalendarView); +//Core.view_registry.add('pms', HotelCalendarView); return PMSCalendarView; diff --git a/hotel_calendar/views/hotel_calendar_management_views.xml b/hotel_calendar/views/hotel_calendar_management_views.xml new file mode 100644 index 000000000..da3c3aef3 --- /dev/null +++ b/hotel_calendar/views/hotel_calendar_management_views.xml @@ -0,0 +1,12 @@ + + + + + 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 new file mode 100644 index 000000000..f07778c81 --- /dev/null +++ b/hotel_calendar/views/hotel_reservation_views.xml @@ -0,0 +1,12 @@ + + + + + hotel.reservation.pms + hotel.reservation + + + + + + diff --git a/hotel_channel_connector/backend.py b/hotel_channel_connector/backend.py new file mode 100644 index 000000000..d6ca5f1c7 --- /dev/null +++ b/hotel_channel_connector/backend.py @@ -0,0 +1,6 @@ +import openerp.addons.connector.backend as backend + + +wubook = backend.Backend('wubook') +# version 1.2 +wubook_1_2_0_0 = backend.Backend(parent=wubook, version='1.2') diff --git a/hotel_channel_connector/components/backend_adapter.py b/hotel_channel_connector/components/backend_adapter.py index 054fc551c..8de7f03d0 100644 --- a/hotel_channel_connector/components/backend_adapter.py +++ b/hotel_channel_connector/components/backend_adapter.py @@ -8,6 +8,7 @@ from odoo.tools import ( DEFAULT_SERVER_DATETIME_FORMAT) from odoo.addons.payment.models.payment_acquirer import _partner_split_name from odoo.addons.hotel import date_utils +from odoo import fields # GLOBAL VARS DEFAULT_WUBOOK_DATE_FORMAT = "%d/%m/%Y" @@ -81,10 +82,20 @@ class WuBookServer(object): self._server = None class HotelChannelInterfaceAdapter(AbstractComponent): - _name = 'hotel.channel.interface.adapter' + _name = 'hotel.channel.adapter' _inherit = ['base.backend.adapter', 'base.hotel.channel.connector'] _usage = 'backend.adapter' + def _select_versions(self): + return [ + ('1.2', '1.2'), + ] + version = fields.Selection( + selection='_select_versions', + string='Version', + required=True, + ) + def create_room(self, shortcode, name, capacity, price, availability): raise NotImplementedError @@ -191,7 +202,7 @@ class HotelChannelInterfaceAdapter(AbstractComponent): class WuBookAdapter(AbstractComponent): _name = 'wubook.adapter' - _inherit = 'hotel.channel.interface.adapter' + _inherit = 'hotel.channel.adapter' # === ROOMS def create_room(self, shortcode, name, capacity, price, availability): diff --git a/hotel_channel_connector/wizard/wubook_import_availability.py b/hotel_channel_connector/wizard/wubook_import_availability.py index fad2af940..3febebe84 100644 --- a/hotel_channel_connector/wizard/wubook_import_availability.py +++ b/hotel_channel_connector/wizard/wubook_import_availability.py @@ -21,7 +21,7 @@ ############################################################################## from openerp.exceptions import ValidationError from openerp import models, fields, api, _ -from ..wubook import DEFAULT_WUBOOK_DATE_FORMAT +from ..components.backend_adapter import DEFAULT_WUBOOK_DATE_FORMAT class ImportAvailabilityWizard(models.TransientModel): diff --git a/hotel_channel_connector/wizard/wubook_import_plan_prices.py b/hotel_channel_connector/wizard/wubook_import_plan_prices.py index 42463e8f8..b07c5ec3e 100644 --- a/hotel_channel_connector/wizard/wubook_import_plan_prices.py +++ b/hotel_channel_connector/wizard/wubook_import_plan_prices.py @@ -22,7 +22,7 @@ from openerp.exceptions import ValidationError from openerp import models, fields, api, _ from odoo.addons.hotel import date_utils -from ..wubook import DEFAULT_WUBOOK_DATE_FORMAT +from ..components.backend_adapter import DEFAULT_WUBOOK_DATE_FORMAT class ImportPlanPricesWizard(models.TransientModel): diff --git a/hotel_channel_connector/wizard/wubook_import_plan_restrictions.py b/hotel_channel_connector/wizard/wubook_import_plan_restrictions.py index e46c5e813..e22fa7ffb 100644 --- a/hotel_channel_connector/wizard/wubook_import_plan_restrictions.py +++ b/hotel_channel_connector/wizard/wubook_import_plan_restrictions.py @@ -22,7 +22,7 @@ from openerp.exceptions import ValidationError from openerp import models, fields, api, _ from odoo.addons.hotel import date_utils -from ..wubook import DEFAULT_WUBOOK_DATE_FORMAT +from ..components.backend_adapter import DEFAULT_WUBOOK_DATE_FORMAT class ImportPlanRestrictionsWizard(models.TransientModel): diff --git a/hotel_channel_connector/wizard/wubook_installer.py b/hotel_channel_connector/wizard/wubook_installer.py index ff745d68d..e671e9e44 100644 --- a/hotel_channel_connector/wizard/wubook_installer.py +++ b/hotel_channel_connector/wizard/wubook_installer.py @@ -23,7 +23,7 @@ import os import binascii from openerp import models, fields, api, _ from openerp.exceptions import ValidationError -from ..wubook import DEFAULT_WUBOOK_DATE_FORMAT +from ..components.backend_adapter import DEFAULT_WUBOOK_DATE_FORMAT from odoo.addons.hotel import date_utils