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 Wizardir.actions.act_windowhotel.folio.wizard
-
+ formformnew
diff --git a/hotel_calendar/__manifest__.py b/hotel_calendar/__manifest__.py
index 0e910b00b..059b84965 100644
--- a/hotel_calendar/__manifest__.py
+++ b/hotel_calendar/__manifest__.py
@@ -29,7 +29,6 @@
'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 Calendarhotel.reservation
-
+ form
@@ -15,7 +15,7 @@
-
+ Hotel Calendar Managementhotel.calendar.managementform
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.reservationformtree,form
- [('is_checkin','=', True)]
+ [('checkin','=', datetime.datetime.now().strftime('%Y-%m-%d'))]
@@ -14,7 +14,7 @@
hotel.reservationformtree,form
- [('is_checkout','=', True)]
+ [('checkout','=', datetime.datetime.now().strftime('%Y-%m-%d'))]
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_hotel_calendar_management.py b/hotel_calendar_channel_connector/models/inherited_hotel_calendar_management.py
index 4ff07ee0f..b121372d3 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):
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..32247a18d 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__)
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_channel_connector/__manifest__.py b/hotel_channel_connector/__manifest__.py
index b478791b1..b696b058b 100644
--- a/hotel_channel_connector/__manifest__.py
+++ b/hotel_channel_connector/__manifest__.py
@@ -5,7 +5,7 @@
'name': 'Hotel Channel Connector',
'version': '1.0',
'author': "Alexandre Díaz ",
- 'website': 'https://www.eiqui.com',
+ 'website': 'https://github.com/hootel/hootel',
'category': 'hotel/connector',
'summary': "Hotel Channel Connector Base",
'description': "Hotel Channel Connector Base",
@@ -18,9 +18,6 @@
},
'data': [
'data/cron_jobs.xml',
- 'wizard/wubook_import_plan_prices.xml',
- 'wizard/wubook_import_plan_restrictions.xml',
- 'wizard/wubook_import_availability.xml',
'views/general.xml',
'views/hotel_channel_connector_issue_views.xml',
'views/inherited_hotel_reservation_views.xml',
diff --git a/hotel_channel_connector/tests/__init__.py b/hotel_channel_connector/tests/__init__.py
index 02e8b3fcb..c9580b6f0 100644
--- a/hotel_channel_connector/tests/__init__.py
+++ b/hotel_channel_connector/tests/__init__.py
@@ -1,22 +1,2 @@
-# -*- 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 .
-#
-##############################################################################
+# Copyright 2018 Alexandre Díaz
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
diff --git a/hotel_channel_connector/views/channel_connector_backend_views.xml b/hotel_channel_connector/views/channel_connector_backend_views.xml
index bfa2f9357..34438bec7 100644
--- a/hotel_channel_connector/views/channel_connector_backend_views.xml
+++ b/hotel_channel_connector/views/channel_connector_backend_views.xml
@@ -197,7 +197,7 @@
channel.backendformtree,form
-
+
diff --git a/hotel_channel_connector/views/inherited_hotel_folio_views.xml b/hotel_channel_connector/views/inherited_hotel_folio_views.xml
index a0bc01a5d..3821538be 100644
--- a/hotel_channel_connector/views/inherited_hotel_folio_views.xml
+++ b/hotel_channel_connector/views/inherited_hotel_folio_views.xml
@@ -3,19 +3,12 @@
hotel.folio
-
+
-
-
-
-
- hotel.folio
-
-
diff --git a/hotel_channel_connector/wizard/__init__.py b/hotel_channel_connector/wizard/__init__.py
index 937912893..a3dcb1741 100644
--- a/hotel_channel_connector/wizard/__init__.py
+++ b/hotel_channel_connector/wizard/__init__.py
@@ -1,27 +1,5 @@
-# -*- 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 . import wubook_import_plan_prices
-from . import wubook_import_plan_restrictions
-from . import wubook_import_availability
+# Copyright 2018 Alexandre Díaz
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import inherited_massive_changes
from . import inherited_duplicate_reservation
from . import inherited_massive_price_reservation_days
diff --git a/hotel_channel_connector/wizard/inherited_duplicate_reservation.py b/hotel_channel_connector/wizard/inherited_duplicate_reservation.py
index 65eab1c50..c2dbb9415 100644
--- a/hotel_channel_connector/wizard/inherited_duplicate_reservation.py
+++ b/hotel_channel_connector/wizard/inherited_duplicate_reservation.py
@@ -1,26 +1,7 @@
-# -*- 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.exceptions import ValidationError
-from openerp import models, api, _
+# Copyright 2018 Alexandre Díaz
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
+from odoo.exceptions import ValidationError
+from odoo import models, api, _
class MassiveChangesWizard(models.TransientModel):
diff --git a/hotel_channel_connector/wizard/inherited_massive_changes.py b/hotel_channel_connector/wizard/inherited_massive_changes.py
index 8c7e4baac..200de2537 100644
--- a/hotel_channel_connector/wizard/inherited_massive_changes.py
+++ b/hotel_channel_connector/wizard/inherited_massive_changes.py
@@ -1,27 +1,8 @@
-# -*- 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 .
-#
-##############################################################################
+# Copyright 2018 Alexandre Díaz
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from datetime import datetime, timedelta
-from openerp.exceptions import ValidationError
-from openerp import models, api
+from odoo.exceptions import ValidationError
+from odoo import models, api
class MassiveChangesWizard(models.TransientModel):
diff --git a/hotel_channel_connector/wizard/inherited_massive_price_reservation_days.py b/hotel_channel_connector/wizard/inherited_massive_price_reservation_days.py
index bc2985c70..f85915090 100644
--- a/hotel_channel_connector/wizard/inherited_massive_price_reservation_days.py
+++ b/hotel_channel_connector/wizard/inherited_massive_price_reservation_days.py
@@ -1,25 +1,7 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2018 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.exceptions import ValidationError
-from openerp import models, api, _
+# Copyright 2018 Alexandre Díaz
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
+from odoo.exceptions import ValidationError
+from odoo import models, api, _
class MassivePriceChangeWizard(models.TransientModel):
diff --git a/hotel_channel_connector/wizard/wubook_import_availability.py b/hotel_channel_connector/wizard/wubook_import_availability.py
deleted file mode 100644
index 3febebe84..000000000
--- a/hotel_channel_connector/wizard/wubook_import_availability.py
+++ /dev/null
@@ -1,43 +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.exceptions import ValidationError
-from openerp import models, fields, api, _
-from ..components.backend_adapter import DEFAULT_WUBOOK_DATE_FORMAT
-
-
-class ImportAvailabilityWizard(models.TransientModel):
- _name = 'wubook.wizard.availability'
-
- date_start = fields.Datetime('Start Date', required=True)
- date_end = fields.Datetime('End Date', required=True)
- set_max_avail = fields.Boolean('Set max avail?', default=True)
-
- @api.multi
- def import_availability(self):
- for record in self:
- wres = self.env['wubook'].fetch_rooms_values(
- record.date_start,
- record.date_end,
- set_max_avail=record.set_max_avail)
- if not wres:
- raise ValidationError(_("Can't fetch availability from WuBook"))
- return True
diff --git a/hotel_channel_connector/wizard/wubook_import_availability.xml b/hotel_channel_connector/wizard/wubook_import_availability.xml
deleted file mode 100644
index 7ef14c0cf..000000000
--- a/hotel_channel_connector/wizard/wubook_import_availability.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
- wubook.wizard.availability
- wubook.wizard.availability
-
-
-
-
-
-
- Import Availability
- ir.actions.act_window
- wubook.wizard.availability
-
- form
- form
- new
-
-
-
diff --git a/hotel_channel_connector/wizard/wubook_import_plan_prices.py b/hotel_channel_connector/wizard/wubook_import_plan_prices.py
deleted file mode 100644
index 60ee6fb86..000000000
--- a/hotel_channel_connector/wizard/wubook_import_plan_prices.py
+++ /dev/null
@@ -1,48 +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.exceptions import ValidationError
-from openerp import models, fields, api, _
-from ..components.backend_adapter import DEFAULT_WUBOOK_DATE_FORMAT
-
-
-class ImportPlanPricesWizard(models.TransientModel):
- _name = 'wubook.wizard.plan.prices'
-
- date_start = fields.Datetime('Start Date', required=True)
- date_end = fields.Datetime('End Date', required=True)
-
- @api.multi
- def import_plan_prices(self):
- pricelist_id = self.env['product.pricelist'].browse(
- self.env.context.get('active_id'))
- if pricelist_id:
- for record in self:
- date_start_dt = fields.Date.from_string(record.date_start)
- date_end_dt = fields.Date.from_string(record.date_end)
- wres = self.env['wubook'].fetch_plan_prices(
- pricelist_id.wpid,
- date_start_dt.strftime(DEFAULT_WUBOOK_DATE_FORMAT),
- date_end_dt.strftime(DEFAULT_WUBOOK_DATE_FORMAT))
- if not wres:
- raise ValidationError(_("Can't fetch plan prices \
- from WuBook"))
- return True
diff --git a/hotel_channel_connector/wizard/wubook_import_plan_prices.xml b/hotel_channel_connector/wizard/wubook_import_plan_prices.xml
deleted file mode 100644
index 72af6ce06..000000000
--- a/hotel_channel_connector/wizard/wubook_import_plan_prices.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
- wubook.wizard.plan.prices
- wubook.wizard.plan.prices
-
-
-
-
-
-
- Import Plan Prices
- ir.actions.act_window
- wubook.wizard.plan.prices
-
- form
- form
- new
-
-
-
diff --git a/hotel_channel_connector/wizard/wubook_import_plan_restrictions.py b/hotel_channel_connector/wizard/wubook_import_plan_restrictions.py
deleted file mode 100644
index 6f834bfd9..000000000
--- a/hotel_channel_connector/wizard/wubook_import_plan_restrictions.py
+++ /dev/null
@@ -1,53 +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.exceptions import ValidationError
-from openerp import models, fields, api, _
-from ..components.backend_adapter import DEFAULT_WUBOOK_DATE_FORMAT
-
-
-class ImportPlanRestrictionsWizard(models.TransientModel):
- _name = 'wubook.wizard.plan.restrictions'
-
- date_start = fields.Datetime('Start Date', required=True)
- date_end = fields.Datetime('End Date', required=True)
-
- @api.multi
- def import_plan_restrictions(self):
- restriction_id = self.env['hotel.room.type.restriction'].browse(
- self.env.context.get('active_id'))
- if restriction_id:
- for record in self:
- date_start_dt = fields.Date.from_string(record.date_start)
- date_end_dt = fields.Date.from_string(record.date_end)
- if int(restriction_id.wpid) == 0:
- wres = self.env['wubook'].fetch_rooms_values(
- date_start_dt.strftime(DEFAULT_WUBOOK_DATE_FORMAT),
- date_end_dt.strftime(DEFAULT_WUBOOK_DATE_FORMAT))
- else:
- wres = self.env['wubook'].fetch_rplan_restrictions(
- date_start_dt.strftime(DEFAULT_WUBOOK_DATE_FORMAT),
- date_end_dt.strftime(DEFAULT_WUBOOK_DATE_FORMAT),
- restriction_id.wpid)
- if not wres:
- raise ValidationError(_("Can't fetch restrictions \
- from WuBook"))
- return True
diff --git a/hotel_channel_connector/wizard/wubook_import_plan_restrictions.xml b/hotel_channel_connector/wizard/wubook_import_plan_restrictions.xml
deleted file mode 100644
index f182739d2..000000000
--- a/hotel_channel_connector/wizard/wubook_import_plan_restrictions.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
- wubook.wizard.plan.prices
- wubook.wizard.plan.prices
-
-
-
-
-
-
- Import Plan Restrictions
- ir.actions.act_window
- wubook.wizard.plan.restrictions
-
- form
- form
- new
- {'restriction_id': [active_id]}
-
-
-