Files
pms/hotel_channel_connector/models/channel_ota_info/common.py
QS5ELkMu 9c76c0e932 Finalize Calendar & Connector integration (#69)
* [WIP] Refactor calendar_channel_connector

* [FIX] Hotel Calendar + Hotel Connector

* [ADD] Push URLs

* [IMP] Connector

* [IMP] Notifications

* [ADD] hotel_channel_connector_wubook

* [FIX] missing imports

* [IMP] Clean code
2018-11-25 17:38:24 +01:00

29 lines
980 B
Python

# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, models, fields
from odoo.addons.queue_job.job import job
class ChannelOtaInfo(models.Model):
_name = 'channel.ota.info'
_inherit = 'channel.binding'
_description = 'Channel OTA Info'
ota_id = fields.Char("Channel OTA ID", required=True)
name = fields.Char("OTA Name", required=True)
@job(default_channel='root.channel')
@api.model
def import_otas_info(self, backend):
with backend.work_on(self._name) as work:
importer = work.component(usage='ota.info.importer')
return importer.import_otas_info()
@job(default_channel='root.channel')
@api.model
def push_activation(self, backend, base_url):
with backend.work_on(self._name) as work:
importer = work.component(usage='ota.info.importer')
return importer.push_activation(base_url)