Skip to content

Module Architecture

flowchart TD
    DBFMOD["sadeem_saas_dbfilter\nDBFilter SAAS"]

    SRV["sadeem.dbfilter.server (inherit)\nadds Sync Databases action button\non server form view"]
    WIZ["sadeem.saas.dbfilter.sync.db\ntransient wizard\nselect databases to import"]
    SUB["sadeem.subscription\ncreated for each selected database"]

    DBFMOD --> SRV
    SRV --> WIZ

    WIZ --> A1([action_load_databases\nfetch DB list from remote slave server])
    WIZ --> A2([action_sync_databases\ncreate subscription per selected database])
    WIZ --> A3([_build_subscription_vals\nmap DB name to subscription field values])

    A1 --> EXT[/DBFilter Slave Agent\nremote Odoo slave instance/]
    A2 --> SUB
    A3 --> A2

Module Description

DBFilter Sync Databases - Allows importing existing databases from a DBFilter server into Sadeem subscriptions in bulk. Useful for onboarding existing Odoo instances that were not originally provisioned through the SaaS system.

Dependencies

  • sadeem_saas_dbfilter

Menus

This module adds a Sync Databases button directly on the DBFilter Server form. There are no additional menu items.

Key Fields

Sync Wizard (sadeem.dbfilter.sync.db.wizard — TransientModel)

Field Type Description
server_id Many2one The DBFilter server to import databases from (read-only, set by context)
line_ids One2many List of discovered databases to sync

Sync Wizard Line (sadeem.dbfilter.sync.db.wizard.line — TransientModel)

Field Type Description
wizard_id Many2one Parent wizard
db_name Char Database name on the remote server
selected Boolean Whether this database should be imported (default: True)

Lifecycle & States

This module has no state machine — it is a single-shot import wizard: 1. Open the wizard from the DBFilter Server form (button: Sync Databases) 2. The wizard fetches the list of existing databases from the remote slave (action_load_databases) 3. User deselects any databases to exclude 4. Click Syncaction_sync creates one sadeem.subscription record per selected database

Key Actions

Action Model Description
action_load_databases sadeem.dbfilter.server (inherit) Opens the sync wizard pre-populated with the server
action_sync sadeem.dbfilter.sync.db.wizard Creates sadeem.subscription records for each selected database
_build_subscription_vals sadeem.dbfilter.sync.db.wizard Maps database name to subscription field values (domain, server, type)

Warnings & Important Notes

  • At least one database must be selected: action_sync raises UserError if no lines are marked as selected.
  • No provisioning: This wizard only creates subscription records — it does NOT create databases. The databases must already exist on the remote DBFilter server.
  • Wizard only: This module adds no persistent models beyond the two TransientModel wizard classes.