Files
odoo_source/addons/calendar/controllers/bus.py
T
Aaron Bohy 488e9f299d [IMP] calendar: remove /calendar/notify RPC done every 5 minutes
Basicaly, do this RPC once, at webclient startup, to get the next notification.
Do the RPC again when the notification is displayed to get the next one.
When an event with alarm is created, edited or removed, trigger an event on the
bus for all involved users (the attendees) with an update of their next
calendar notification.
2016-06-27 15:30:45 +02:00

14 lines
520 B
Python

# -*- coding: utf-8 -*
import openerp
from openerp.http import request
class CalendarBusController(openerp.addons.bus.controllers.main.BusController):
# --------------------------
# Extends BUS Controller Poll
# --------------------------
def _poll(self, dbname, channels, last, options):
if request.session.uid:
channels.append((request.db, 'calendar.alarm', request.env.user.partner_id.id))
return super(CalendarBusController, self)._poll(dbname, channels, last, options)