sync_contacts — App

Version: 19.0.0.1.0 · Depends: sync_base, contacts · License: OPL-1

sync_contacts synchronizes Odoo Contacts across independent databases via the Sync framework. It runs on a daily batched schedule to securely federate network identities.

Overview

Contacts (res.partner) are batched and exported daily, matching across nodes via their sync_uuid.

Scoping (the for operator on the schema’s __root__) enforces that only updates originating from the contact’s authoritative node (the node hosting the associated ip.peer) are processed, protecting contacts against unauthorized network overwrites.


class res.partner[source]

Attributes

sync_uuid: fields.Char[source]
UUID generated on contact creation. Used as the cross-node routing and deduplication key in ip.topic payloads.
sync_date: fields.Datetime[source]
Timestamp of the last successful batch export. Stamped automatically by the topic’s post-export server action.
sync_pending: fields.Boolean[source]
Compute field returning True if the contact was modified since its last export (write_date > sync_date). Driving metric for the daily batched sweep.
sync_author_node_id: fields.Many2one[source]
The authoritative node for this contact. Inherited from parent if not set.
sync_alias_ids: fields.One2many[source]
List of UUIDs that have been merged into this contact.

Methods

_compute_sync_author_node()[source]

Compute the author node by inheriting from the parent or defaulting to the local gateway.

_compute_sync_pending()[source]

Compute whether the record has been modified since the last sync date.


class res.partner.alias[source]

Attributes

partner_id: fields.Many2one[source]
The surviving contact record that swallowed the aliased UUID.
sync_uuid: fields.Char[source]
The swallowed contact’s UUID. Inbound payloads matching this UUID will be rerouted to the surviving partner_id.

class ip.schema[source]

Methods

_trait_resolve_alias_pre(value, config: dict, context: dict) → None[source]

Intercept payloads before mapping and use the exact AST configurations passed to find all JSON paths flagged with resolve_alias: true. Checks if those extracted UUIDs match any known aliases, and mutates the payload inline to use the surviving contact’s UUID.

Parameters:
  • value – None (unused).

  • config – The AST trait configuration containing {“ast_nodes”: […]}.

  • context – The context dictionary containing payload_list.

_trait_set_from_node_mid(value, config: dict, context: dict)[source]

Replace the value with the source node’s ID, if available.

Parameters:
  • value – The extracted payload value (ignored, overwritten).

  • config – The AST field configuration dictionary.

  • context – The context dictionary containing the source node.

Returns:

The node ID or None.