sync_discuss — App

Version: 19.0.0.4.0 · Depends: sync_base, mail · License: OPL-1

sync_discuss synchronizes Odoo Discuss channels across Sync nodes. Messages, thread replies, and author presence are propagated in real time. Reactions trigger a re-export of the parent message so remote nodes see the updated reaction counts.

Overview

Each Discuss channel that participates in synchronization has a globally unique sync_channel_uuid. This UUID is the cross-node routing key — messages created on Node A land in the correct channel on Node B even when the database id differs.

Thread replies are handled via a schema-driven approach. The engine relies on sync_main_channel_id to route messages, while sub-channels are created automatically with their parent_channel_id and from_message_id fields populated via declarative nested relation lookups. For out-of-order thread replies, a stub mail.message is created for from_message_id, which is later healed in-place when the root payload arrives.


class discuss.channel[source]

Adds a globally unique routing UUID to Discuss channels.

Each channel that participates in synchronization carries a sync_channel_uuid — the cross-node routing key used in topic payloads so messages created on one node land in the correct channel on every other node regardless of database id.

Attributes

sync_channel_uuid: fields.Char[source]

UUID generated on channel creation. Immutable. Used as the cross-node routing key in ip.topic payloads.


class mail.message[source]

Extends messages to handle cross-node thread routing and bus notifications.

Thread replies are anchored via sync_main_channel_id (top-level channel). Sub-channels are created on the receiving node if they do not yet exist.

Attributes

sync_main_channel_id: fields.Many2one[source]
Top-level channel for Sync exchange. Points to the parent channel for thread messages.

Helpers

_trigger_sync_export()[source]

Trigger the Sync export from a related model.

_sync_notify_thread()[source]

Push bus notifications for live Discuss UI updates. For thread sub-channel messages, also notifies the parent channel so SubChannelPreview renders without a system message.

CRUD

create(vals_list)[source]

class mail.message.reaction[source]

Re-exports the parent message when reactions are added or removed.

Reactions are not synced as discrete objects; they travel with the parent mail.message payload. Adding or removing a reaction triggers _trigger_sync_export() on the parent so remote nodes receive the updated reaction state.

Methods

create(vals_list)[source]

Overrides create() to call _trigger_sync_export() on the parent message after a reaction is added.

Overrides unlink() to call _trigger_sync_export() on the parent message after a reaction is removed.


class ip.node[source]

Pushes im_status bus notifications when node liveness changes.

Overrides _on_online_change() to notify all res.partner records linked to the node’s hosted peers, causing the Discuss sidebar to show live presence dots when a remote node comes online or goes offline.

Methods

_on_online_change()[source]

class res.partner[source]

Derives IM status from the liveness of the partner’s host node.

Overrides _compute_im_status() so partners linked to a remote ip.peer show online when their host node is reachable and offline otherwise. Local users continue to use the standard bus.presence mechanism.

Methods

_compute_im_status()[source]