*: hr_presence, web_editor.
This commit is part of the websocket integration in Odoo.
It focuses on adapting the bus to support websockets:
- last notification id is now kept on the server
- channel list is built by overriding the `_build_bus_channel_list`
method of the `ir_websocket` model instead of overriding the `_poll`
method of the bus controller.
- The bus presence was updated during polls, since there is no more poll,
bus presence update will be the responsability of the client.
- The `/websocket/peek_notifications`, `/websocket/update_bus_presence`
routes will be available so that odoo sh can access notifications/update presence
from http requests.
- /longpolling routes are now prefixed with /bus thus won't be redirected to the
gevent worker anymore except for `/longpolling/health` which is the
health check route of the gevent server.
Since websocket now handle incoming messages, a way to manage authentication
have been introduced :
- The session is retrieved from the HTTP handshake.
- When a websocket message comes/leaves the session is retrieved
on the file system so that we're sure it still exists and that
it is up to date.
- The session is checked
- If no session is found on the file system or `check_session`
fails, the websocket connection is closed with the `SESSION_EXPIRED`
close code (which is a custom close code: 4001).
- Note that websocket connections are closed every `KEEP_ALIVE_TIMEOUT`
seconds to ensure no websocket connection will stay open if the user
clears its cookies.
- Note that a wsrequest object is available when processing incoming
messages. It is similar to the http request and contains various
useful informations (session, env, ...).
Part-of: odoo/odoo#75510
62 lines
1.6 KiB
Python
62 lines
1.6 KiB
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
# core models (required for mixins)
|
|
from . import mail_alias
|
|
from . import models
|
|
|
|
# mixin
|
|
from . import mail_activity_mixin
|
|
from . import mail_alias_mixin
|
|
from . import mail_render_mixin
|
|
from . import mail_composer_mixin
|
|
from . import mail_thread
|
|
from . import mail_thread_blacklist
|
|
from . import mail_thread_cc
|
|
from . import template_reset_mixin
|
|
|
|
# mail models
|
|
from . import fetchmail
|
|
from . import mail_notification # keep before as decorated m2m
|
|
from . import mail_activity_type
|
|
from . import mail_activity
|
|
from . import mail_blacklist
|
|
from . import mail_followers
|
|
from . import mail_gateway_allowed
|
|
from . import mail_message_reaction
|
|
from . import mail_message_subtype
|
|
from . import mail_message
|
|
from . import mail_mail
|
|
from . import mail_tracking_value
|
|
from . import mail_template
|
|
|
|
# discuss
|
|
from . import mail_channel_member
|
|
from . import mail_channel_rtc_session
|
|
from . import mail_channel
|
|
from . import mail_guest
|
|
from . import mail_ice_server
|
|
from . import mail_shortcode
|
|
from . import res_users_settings
|
|
from . import res_users_settings_volumes
|
|
|
|
# odoo models
|
|
from . import bus_presence
|
|
from . import ir_action_act_window
|
|
from . import ir_actions_server
|
|
from . import ir_attachment
|
|
from . import ir_config_parameter
|
|
from . import ir_http
|
|
from . import ir_model
|
|
from . import ir_model_fields
|
|
from . import ir_translation
|
|
from . import ir_ui_view
|
|
from . import ir_qweb
|
|
from . import ir_websocket
|
|
from . import res_company
|
|
from . import res_config_settings
|
|
from . import res_partner
|
|
from . import res_users
|
|
from . import res_groups
|
|
from . import update
|