Synchronizers

Import

Importers for Magento.

An import can be skipped if the last sync date is more recent than the last update in Magento.

They should call the bind method if the binder even if the records are already bound, to update the last sync date.

class openerp.addons.magentoerpconnect.unit.import_synchronizer.AddCheckpoint(connector_env)[source]

Bases: openerp.addons.connector.connector.ConnectorUnit

Add a connector.checkpoint on the underlying model (not the magento.* but the _inherits’ed model)

run(openerp_binding_id)[source]
openerp.addons.magentoerpconnect.unit.import_synchronizer.BatchImportSynchronizer

alias of openerp.addons.magentoerpconnect.unit.import_synchronizer.BatchImporter

class openerp.addons.magentoerpconnect.unit.import_synchronizer.BatchImporter(connector_env)[source]

Bases: openerp.addons.connector.unit.synchronizer.Importer

The role of a BatchImporter is to search for a list of items to import, then it can either import them directly or delay the import of each item separately.

run(filters=None)[source]

Run the synchronization

openerp.addons.magentoerpconnect.unit.import_synchronizer.DelayedBatchImport

alias of openerp.addons.magentoerpconnect.unit.import_synchronizer.DelayedBatchImporter

class openerp.addons.magentoerpconnect.unit.import_synchronizer.DelayedBatchImporter(connector_env)[source]

Bases: openerp.addons.magentoerpconnect.unit.import_synchronizer.BatchImporter

Delay import of the records

openerp.addons.magentoerpconnect.unit.import_synchronizer.DirectBatchImport

alias of openerp.addons.magentoerpconnect.unit.import_synchronizer.DirectBatchImporter

class openerp.addons.magentoerpconnect.unit.import_synchronizer.DirectBatchImporter(connector_env)[source]

Bases: openerp.addons.magentoerpconnect.unit.import_synchronizer.BatchImporter

Import the records directly, without delaying the jobs.

openerp.addons.magentoerpconnect.unit.import_synchronizer.MagentoImportSynchronizer

alias of openerp.addons.magentoerpconnect.unit.import_synchronizer.MagentoImporter

class openerp.addons.magentoerpconnect.unit.import_synchronizer.MagentoImporter(connector_env)[source]

Bases: openerp.addons.connector.unit.synchronizer.Importer

Base importer for Magento

run(magento_id, force=False)[source]

Run the synchronization

Parameters:magento_id – identifier of the record on Magento
openerp.addons.magentoerpconnect.unit.import_synchronizer.SimpleRecordImport

alias of openerp.addons.magentoerpconnect.unit.import_synchronizer.SimpleRecordImporter

class openerp.addons.magentoerpconnect.unit.import_synchronizer.SimpleRecordImporter(connector_env)[source]

Bases: openerp.addons.magentoerpconnect.unit.import_synchronizer.MagentoImporter

Import one Magento Website

class openerp.addons.magentoerpconnect.unit.import_synchronizer.TranslationImporter(connector_env)[source]

Bases: openerp.addons.connector.unit.synchronizer.Importer

Import translations for a record.

Usually called from importers, in _after_import. For instance from the products and products’ categories importers.

run(magento_id, binding_id, mapper_class=None)[source]

Run the synchronization

openerp.addons.magentoerpconnect.unit.import_synchronizer.import_batch(session, model_name, backend_id, filters=None)[source]

Prepare a batch import of records from Magento

openerp.addons.magentoerpconnect.unit.import_synchronizer.import_record(session, model_name, backend_id, magento_id, force=False)[source]

Import a record from Magento

Export

class openerp.addons.magentoerpconnect.unit.export_synchronizer.MagentoBaseExporter(connector_env)[source]

Bases: openerp.addons.connector.unit.synchronizer.Exporter

Base exporter for Magento

run(binding_id, *args, **kwargs)[source]

Run the synchronization

Parameters:binding_id – identifier of the binding record to export
class openerp.addons.magentoerpconnect.unit.export_synchronizer.MagentoExporter(connector_env)[source]

Bases: openerp.addons.magentoerpconnect.unit.export_synchronizer.MagentoBaseExporter

A common flow for the exports to Magento

openerp.addons.magentoerpconnect.unit.export_synchronizer.export_record(session, model_name, binding_id, fields=None)[source]

Export a record on Magento

openerp.addons.magentoerpconnect.unit.export_synchronizer.unwrap_binding(session, job, id_pos=2)

Open a form view with the unwrapped record.

For instance, for a job on a magento.product.product, it will open a product.product form view with the unwrapped record.

Parameters:
  • id_pos – position of the binding ID in the args
  • binder_class – base class to search for the binder

Delete

openerp.addons.magentoerpconnect.unit.delete_synchronizer.MagentoDeleteSynchronizer

alias of openerp.addons.magentoerpconnect.unit.delete_synchronizer.MagentoDeleter

class openerp.addons.magentoerpconnect.unit.delete_synchronizer.MagentoDeleter(connector_env)[source]

Bases: openerp.addons.connector.unit.synchronizer.Deleter

Base deleter for Magento

run(magento_id)[source]

Run the synchronization, delete the record on Magento

Parameters:magento_id – identifier of the record to delete
openerp.addons.magentoerpconnect.unit.delete_synchronizer.export_delete_record(session, model_name, backend_id, magento_id)[source]

Delete a record on Magento