You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
695 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2017 LasLabs Inc.
  3. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
  4. from odoo.http import request
  5. from odoo.addons.bus.controllers.main import BusController
  6. class BusController(BusController):
  7. def _poll(self, dbname, channels, last, options):
  8. if request.uid:
  9. partner = request.env.user.partner_id
  10. if 'bus_presence_partner_ids' in options:
  11. options['bus_presence_partner_ids'].append(partner.id)
  12. else:
  13. options['bus_presence_partner_ids'] = [partner.id]
  14. return super(BusController, self)._poll(
  15. dbname, channels, last, options,
  16. )