mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[WIP][MIG][11.0] Hotel Calendar & Hotel Channel Connector
This commit is contained in:
3
hotel_calendar/controllers/__init__.py
Normal file
3
hotel_calendar/controllers/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
from . import bus
|
||||
21
hotel_calendar/controllers/bus.py
Normal file
21
hotel_calendar/controllers/bus.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Copyright 2018 Alexandre Díaz <dev@redneboa.es>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
from odoo.http import request
|
||||
from odoo.addons.bus.controllers.main import BusController
|
||||
|
||||
HOTEL_BUS_CHANNEL_ID = 'hpublic'
|
||||
|
||||
|
||||
# More info...
|
||||
# https://github.com/odoo/odoo/commit/092cf33f93830daf5e704b964724bdf8586da8d9
|
||||
class Controller(BusController):
|
||||
def _poll(self, dbname, channels, last, options):
|
||||
if request.session.uid:
|
||||
# registry, cr, uid, context = request.registry, request.cr, \
|
||||
# request.session.uid, request.context
|
||||
channels = channels + [(
|
||||
request.db,
|
||||
'hotel.reservation',
|
||||
HOTEL_BUS_CHANNEL_ID
|
||||
)]
|
||||
return super(Controller, self)._poll(dbname, channels, last, options)
|
||||
Reference in New Issue
Block a user