Skip to Content

Unlock real time updates with bus.bus and OWL

Duration: 26:36


PART 1 — Analytical Summary 🚀

Context 💼

In “Unlock real-time updates with bus.bus and OWL,” Francisco, a software developer at Odoo with nearly four years of experience, demonstrates how to deliver real-time UI updates in Odoo using the bus.bus messaging system and OWL (Odoo’s front-end framework). The session shows why real-time matters (better UX, collaboration, urgency), what the bus is (a developer-friendly abstraction over WebSockets), and how to implement it safely and scalably in custom modules. The talk includes two demos, security guidance, and a Q&A that clarifies scalability, channel design, and mobile support.

Core ideas & innovations 🧠

Francisco frames bus.bus as Odoo’s server-to-client push channel, powered by WebSockets, but intentionally simplified for developers. On the backend, you send notifications with a “channel + event + payload” triad (think radio: frequency, program, message). On the frontend, OWL’s bus service lets components register channels and react to specific events, updating state without page reloads.

He first shows a sales dashboard that updates instantly as new sale.order records are created by another user. The backend calls the bus to notify clients; the OWL widget subscribes to a channel and updates component state on new events. He then lays out the crucial difference between broadcast-style channels (any logged-in user could listen) and private record-backed channels (permission-gated). A lightweight pattern for safer UX is to broadcast a minimal, non-sensitive event and then refetch data via regular ORM calls, letting standard access rights apply.

The more robust, private approach uses the BusListenerMixin and record channels. Models like res.users, res.groups, and spreadsheet already implement this pattern. With the mixin, developers send messages without manually naming channels; the model’s bus_channel defines the record-based channel, while build_bus_channel_list parses client channel requests, resolves them to records, and enforces permissions before allowing subscription. On the client, components add channels on mount and remove them on destroy to avoid cross-page noise; a single subscription callback can handle events from all active channels.

The second demo, a collaborative clicker game, showcases custom record-based channels: the model inherits BusListenerMixin, sends messages on record updates, and the OWL widget subscribes to “model,id” channels. On the server, build_bus_channel_list validates the user session, parses the channel name, checks access on the specific record, and only then adds it to the channel list—making the channel effectively private.

Impact & takeaways ⚙️

The session translates Odoo’s internal real-time foundations into a practical recipe for custom apps:

  • Real-time UX: Immediate UI updates across users without manual refresh.
  • Developer simplicity: One WebSocket per client with a unified bus service; no need for Socket.IO or custom plumbing.
  • Security by design: Prefer private, record-based channels via BusListenerMixin; otherwise, broadcast only non-sensitive signals and refetch data.
  • Lifecycle discipline: Add channels when a component mounts and remove them when it’s destroyed to avoid stale subscriptions.
  • Familiar patterns: Many Odoo features (notifications, spreadsheets, live chat) already rely on this bus approach, so it’s proven-in-product.

Key Q&A highlights 💬

  • External APIs: You can trigger bus events from API endpoints by calling a public server method that sends notifications—no special client library required.
  • Data size limits: Not precisely defined; practical usage shows large payloads work, but best practice is to keep payloads lean and refetch via ORM when needed.
  • Channel discovery: There’s no endpoint to list channels (by design). Use recognizable naming patterns (e.g., “model,id”) and permission checks in the server’s channel list builder.
  • Collision avoidance: Namespacing via model identifiers prevents channel name collisions.
  • Scalability: Odoo uses a single WebSocket per browser session; typical constraints come from total concurrent connections (often cited around 5k–10k per node). For most deployments, this is sufficient.
  • Mobile: Works in mobile browsers and webviews—WebSockets are supported.
  • SSE vs WebSockets: No plans mentioned to switch; WebSockets are the current standard.
  • Live chat: Yes—Odoo’s live chat already uses the bus.

Net effect: The bus.bus + OWL pattern gives Odoo developers a clean path to real-time experiences that respect access rights and integrate seamlessly with the platform’s model layer.

PART 2 — Viewpoint: Odoo Perspective

Disclaimer: AI-generated creative perspective inspired by Odoo's vision.

Real time is only valuable if it’s simple. The bus exists so developers don’t have to wrestle with WebSockets, scaling, or ad-hoc security. One subscription per client, consistent patterns, and record-based permissions—that’s the Odoo way: keep the complexity out of your business logic.

I’m proud that the same mechanism powering notifications, spreadsheets, and chat is available to every module author. When the community adopts shared patterns like BusListenerMixin and permission-checked channel lists, we all move faster with fewer surprises. Integration over fragmentation—this is how we keep Odoo cohesive and delightful.

PART 3 — Viewpoint: Competitors (SAP / Microsoft / Others)

Disclaimer: AI-generated fictional commentary. Not an official corporate statement.

Odoo’s bus-based real-time model is elegant for integrated suites and midmarket workloads. The record-channel permissions align with application security and the single WebSocket per client reduces operational overhead. For many scenarios, that’s an attractive developer experience and time-to-value advantage.

At very large scales, enterprises will scrutinize connection limits, compliance controls, and observability—particularly around audit trails, data residency, and multi-region resiliency. Deep event ecosystems (e.g., Kafka, Event Hubs) remain important for cross-system streaming and regulatory needs. The UX differentiation is notable; the question is less about feasibility and more about governance and scale guarantees. Still, Odoo’s coherent approach sets a high bar for developer productivity in its target segment.

Disclaimer: This article contains AI-generated summaries and fictionalized commentaries for illustrative purposes. Viewpoints labeled as "Odoo Perspective" or "Competitors" are simulated and do not represent any real statements or positions. All product names and trademarks belong to their respective owners.

Share this post
Archive
Sign in to leave a comment
Cost Center Reporting with Analytic Plans