Bases: connector.connector.ConnectorUnit
For one record of a model, capable to find an external or internal id, or create the binding (link) between them
The Binder should be implemented in the connectors.
Create the link between an external ID and an OpenERP ID
Parameters: |
|
---|
Give the external ID for an OpenERP binding ID (ID in a model magento.*)
Parameters: |
|
---|---|
Returns: |
external ID of the record |
Give the OpenERP ID for an external ID
Parameters: |
|
---|---|
Returns: |
a record ID, depending on the value of unwrap, or None if the external_id is not mapped |
Return type: |
int |
Bases: object
Abstract class for each piece of the connector:
Or basically any class intended to be registered in a Backend.
According to the current Environment, search and returns an instance of the ConnectorUnit for the current model and being a class or subclass of connector_unit_class.
If a model is given, a new Environment is built for this model.
Parameters: |
|
---|
Returns True if the current class correspond to the searched model.
Parameters: |
|
---|
Bases: object
Environment used by the different units for the synchronization.
Current backend we are working with. Obtained with backend_record.get_backend().
Instance of: connector.backend.Backend
Browsable record of the backend. The backend is inherited from the model connector.backend and have at least a type and a version.
Current session we are working in. It contains the OpenERP cr, uid and context.
Name of the OpenERP model to work with.
Searches and returns an instance of the ConnectorUnit for the current model and being a class or subclass of base_class.
The returned instance is built with self for its environment.
Parameters: | base_class (connector.connector.ConnectorUnit) – ConnectorUnit to search (class or subclass) |
---|
Bases: type
Metaclass for ConnectorUnit.
Keeps a _module attribute on the classes, the same way OpenERP does it for the Model classes. It is then used to filter them according to the state of the module (installed or not).
The model_name is used to find the class and is mandatory for ConnectorUnit which are registered on a Backend.
For a top level function or class, returns the name of the OpenERP module where it lives.
So we will be able to filter them according to the modules installation state.
Installs an OpenERP module in the Connector framework.
It has to be called once per OpenERP module to plug.
Under the cover, it creates a orm.AbstractModel whose name is the name of the module with a .intalled suffix: {name_of_the_openerp_module_to_install}.installed.
The connector then uses this model to know when the OpenERP module is installed or not and whether it should use the ConnectorUnit classes of this module or not and whether it should fire the consumers of events or not.