Skip to main content

Auto Sync Cron Jobs

The Magento 2 Connector includes built-in cron job support that automates data synchronization between Odoo and Magento at configurable intervals. This eliminates the need for manual sync operations and keeps your data continuously up to date.

Enabling Auto Sync

Auto sync is configured per instance:

  1. Navigate to Magento > Instances.
  2. Open your instance.
  3. Scroll down to the Auto Sync Cron section.
  4. Configure the following settings:

Schedule Settings

FieldDescriptionDefault
Auto Sync EnabledMaster toggle to enable or disable automatic synchronizationDisabled
Auto Sync FrequencyHow often the sync runs (Hourly, Daily, Weekly)Hourly
Hourly IntervalSpecific interval between sync runs (e.g., Every 1 hour(s))Every 1 hour(s)

Auto Sync Scope

Select which data types to include in each automatic sync run:

Scope OptionDescription
ProductsAutomatically sync products between Odoo and Magento
CustomersAutomatically sync customer records
CategoriesAutomatically sync product categories
OrdersAutomatically sync orders, invoices, and shipments
info

You can enable or disable each scope independently. For example, you might want to sync orders every hour but only sync products once daily.

Built-in Cron Jobs

The connector registers the following cron jobs in Odoo's scheduler:

Cron JobDescriptionSource Action
Magento Product SyncPulls/pushes product data between systemscron_auto_scope
Magento Customer SyncSynchronizes customer recordscron_auto_scope
Magento Category SyncSynchronizes product categoriescron_auto_scope
Magento Order SyncImports new and updated orders from Magentocron_auto_scope
Magento Inventory SyncUpdates stock quantities across platformscron_auto_scope

How Auto Sync Works

  1. Cron Trigger -- Odoo's scheduled action system triggers the sync job at the configured interval.
  2. Scope Check -- The connector checks which data types are enabled in the Auto Sync Scope.
  3. API Call -- For each enabled scope, the connector queries the Magento REST API for new or updated records.
  4. Data Processing -- New records are created in Odoo; existing records are updated with the latest data.
  5. Report Logging -- Each sync operation is logged in the Sync Reports with success/error counts, start time, and end time.

Monitoring Cron Jobs

You can monitor cron job execution in two ways:

Via Sync Reports

Navigate to Magento > Reports > Sync Reports to view detailed logs of every auto-sync run. Each entry shows:

  • The sync type and mode (Cron)
  • Source action (cron_auto_scope)
  • Total records processed
  • Success and error counts
  • Start and end timestamps

Via Odoo Scheduled Actions

Navigate to Settings > Technical > Scheduled Actions to view and manage the underlying Odoo cron jobs. Here you can:

  • View the next execution time
  • Manually trigger a cron job
  • Adjust the technical interval settings
tip

If auto-sync appears to not be running, check the Odoo Scheduled Actions view to ensure the cron jobs are active and not stuck.

Best Practices

  • Start with hourly sync -- Begin with hourly synchronization and adjust based on your volume and needs.
  • Monitor error counts -- Regularly check Sync Reports for rising error counts that may indicate connectivity or data issues.
  • Off-peak scheduling -- For large catalogs, consider running full product syncs during off-peak hours to minimize API load.
  • Order sync priority -- Orders should generally sync more frequently than products or categories, as they are time-sensitive.
warning

Running sync too frequently (e.g., every few minutes) may put excessive load on both Odoo and Magento servers. Hourly sync is recommended for most use cases.

Next Steps