Partner¶
-
class
openerp.addons.magentoerpconnect.partner.
AddressAdapter
(connector_env)[source]¶ Bases:
openerp.addons.magentoerpconnect.unit.backend_adapter.GenericAdapter
-
openerp.addons.magentoerpconnect.partner.
AddressImport
¶ alias of
openerp.addons.magentoerpconnect.partner.AddressImporter
-
class
openerp.addons.magentoerpconnect.partner.
AddressImportMapper
(connector_env)[source]¶ Bases:
openerp.addons.magentoerpconnect.partner.BaseAddressImportMapper
-
direct
= [('postcode', 'zip'), ('city', 'city'), ('telephone', 'phone'), ('fax', 'fax'), ('company', 'company'), ('created_at', 'created_at'), ('updated_at', 'updated_at'), ('is_default_billing', 'is_default_billing'), ('is_default_shipping', 'is_default_shipping'), ('company', 'company')]¶
-
-
class
openerp.addons.magentoerpconnect.partner.
AddressImporter
(connector_env)[source]¶ Bases:
openerp.addons.magentoerpconnect.unit.import_synchronizer.MagentoImporter
-
class
openerp.addons.magentoerpconnect.partner.
AddressInfos
(magento_record, partner_binding_id, merge)¶ Bases:
tuple
-
magento_record
¶ Alias for field number 0
-
merge
¶ Alias for field number 2
-
partner_binding_id
¶ Alias for field number 1
-
-
class
openerp.addons.magentoerpconnect.partner.
BaseAddressImportMapper
(connector_env)[source]¶ Bases:
openerp.addons.connector.unit.mapper.ImportMapper
Defines the base mappings for the imports in
res.partner
(state, country, …)-
direct
= [('postcode', 'zip'), ('city', 'city'), ('telephone', 'phone'), ('fax', 'fax'), ('company', 'company')]¶
-
-
class
openerp.addons.magentoerpconnect.partner.
CompanyImportMapper
(connector_env)[source]¶ Bases:
openerp.addons.magentoerpconnect.partner.BaseAddressImportMapper
Special mapping used when we import a company. A company is considered as such when the billing address of an account has something in the ‘company’ field.
This is a very special mapping not used in the same way than the other.
The billing address will exist as a contact, but we want to copy the data on the company.
The input record is the billing address. The mapper returns data which will be written on the main partner, in other words, the company.
The
@only_create
decorator would not have any effect here because the mapper is always called for updates.-
direct
= [('postcode', 'zip'), ('city', 'city'), ('telephone', 'phone'), ('fax', 'fax'), ('company', 'company'), ('company', 'name')]¶
-
-
class
openerp.addons.magentoerpconnect.partner.
MagentoAddress
(pool, cr)[source]¶ Bases:
openerp.models.Model
-
backend_id
¶ The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
Parameters: - comodel_name – name of the target model (string)
- domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- ondelete – what to do when the referred record is deleted;
possible values are:
'set null'
,'restrict'
,'cascade'
- auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False
) - delegate – set it to
True
to make fields of the target model accessible from the current model (corresponds to_inherits
)
The attribute
comodel_name
is mandatory except in the case of related fields or field extensions.
-
created_at
¶
-
is_default_billing
¶
-
is_default_shipping
¶
-
is_magento_order_address
¶
-
magento_partner_id
¶ The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
Parameters: - comodel_name – name of the target model (string)
- domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- ondelete – what to do when the referred record is deleted;
possible values are:
'set null'
,'restrict'
,'cascade'
- auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False
) - delegate – set it to
True
to make fields of the target model accessible from the current model (corresponds to_inherits
)
The attribute
comodel_name
is mandatory except in the case of related fields or field extensions.
-
openerp_id
¶ The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
Parameters: - comodel_name – name of the target model (string)
- domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- ondelete – what to do when the referred record is deleted;
possible values are:
'set null'
,'restrict'
,'cascade'
- auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False
) - delegate – set it to
True
to make fields of the target model accessible from the current model (corresponds to_inherits
)
The attribute
comodel_name
is mandatory except in the case of related fields or field extensions.
-
updated_at
¶
-
website_id
¶ The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
Parameters: - comodel_name – name of the target model (string)
- domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- ondelete – what to do when the referred record is deleted;
possible values are:
'set null'
,'restrict'
,'cascade'
- auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False
) - delegate – set it to
True
to make fields of the target model accessible from the current model (corresponds to_inherits
)
The attribute
comodel_name
is mandatory except in the case of related fields or field extensions.
-
-
class
openerp.addons.magentoerpconnect.partner.
MagentoResPartner
(pool, cr)[source]¶ Bases:
openerp.models.Model
-
backend_id
¶ The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
Parameters: - comodel_name – name of the target model (string)
- domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- ondelete – what to do when the referred record is deleted;
possible values are:
'set null'
,'restrict'
,'cascade'
- auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False
) - delegate – set it to
True
to make fields of the target model accessible from the current model (corresponds to_inherits
)
The attribute
comodel_name
is mandatory except in the case of related fields or field extensions.
-
consider_as_company
¶
-
created_at
¶
-
emailid
¶ Basic string field, can be length-limited, usually displayed as a single-line string in clients
Parameters:
-
group_id
¶ The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
Parameters: - comodel_name – name of the target model (string)
- domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- ondelete – what to do when the referred record is deleted;
possible values are:
'set null'
,'restrict'
,'cascade'
- auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False
) - delegate – set it to
True
to make fields of the target model accessible from the current model (corresponds to_inherits
)
The attribute
comodel_name
is mandatory except in the case of related fields or field extensions.
-
guest_customer
¶
-
openerp_id
¶ The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
Parameters: - comodel_name – name of the target model (string)
- domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- ondelete – what to do when the referred record is deleted;
possible values are:
'set null'
,'restrict'
,'cascade'
- auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False
) - delegate – set it to
True
to make fields of the target model accessible from the current model (corresponds to_inherits
)
The attribute
comodel_name
is mandatory except in the case of related fields or field extensions.
-
taxvat
¶ Basic string field, can be length-limited, usually displayed as a single-line string in clients
Parameters:
-
updated_at
¶
-
website_id
¶ The value of such a field is a recordset of size 0 (no record) or 1 (a single record).
Parameters: - comodel_name – name of the target model (string)
- domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- ondelete – what to do when the referred record is deleted;
possible values are:
'set null'
,'restrict'
,'cascade'
- auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False
) - delegate – set it to
True
to make fields of the target model accessible from the current model (corresponds to_inherits
)
The attribute
comodel_name
is mandatory except in the case of related fields or field extensions.
-
-
class
openerp.addons.magentoerpconnect.partner.
PartnerAdapter
(connector_env)[source]¶ Bases:
openerp.addons.magentoerpconnect.unit.backend_adapter.GenericAdapter
-
class
openerp.addons.magentoerpconnect.partner.
PartnerAddressBook
(connector_env)[source]¶ Bases:
openerp.addons.connector.connector.ConnectorUnit
Import all addresses from the address book of a customer.
This class is responsible to define which addresses should be imported and how (merge with the partner or not…). Then, it delegate the import to the appropriate importer.
This is really intricate. The datamodel are different between Magento and OpenERP and we have many uses cases to cover.
- The first thing is that:
- we do not import companies and individuals the same manner
- we do not know if an account is a company -> we assume that if we found something in the company field of the billing address, the whole account is a company.
- Differences:
- Individuals: we merge the billing address with the partner, so we’ll end with 1 entity if the customer has 1 address
- Companies: we never merge the addresses with the partner, but we use the company name of the billing address as name of the partner. We also copy the address informations from the billing address as default values.
More information on: https://bugs.launchpad.net/openerp-connector/+bug/1193281
-
openerp.addons.magentoerpconnect.partner.
PartnerBatchImport
¶ alias of
openerp.addons.magentoerpconnect.partner.PartnerBatchImporter
-
class
openerp.addons.magentoerpconnect.partner.
PartnerBatchImporter
(connector_env)[source]¶ Bases:
openerp.addons.magentoerpconnect.unit.import_synchronizer.DelayedBatchImporter
Import the Magento Partners.
For every partner in the list, a delayed job is created.
-
openerp.addons.magentoerpconnect.partner.
PartnerImport
¶ alias of
openerp.addons.magentoerpconnect.partner.PartnerImporter
-
class
openerp.addons.magentoerpconnect.partner.
PartnerImportMapper
(connector_env)[source]¶ Bases:
openerp.addons.connector.unit.mapper.ImportMapper
-
direct
= [('email', 'email'), ('dob', 'birthday'), (<function modifier>, 'created_at'), (<function modifier>, 'updated_at'), ('email', 'emailid'), ('taxvat', 'taxvat'), ('group_id', 'group_id')]¶
-
-
class
openerp.addons.magentoerpconnect.partner.
PartnerImporter
(connector_env)[source]¶ Bases:
openerp.addons.magentoerpconnect.unit.import_synchronizer.MagentoImporter
-
class
openerp.addons.magentoerpconnect.partner.
ResPartner
(pool, cr)[source]¶ Bases:
openerp.models.Model
-
birthday
¶
-
company
¶ Basic string field, can be length-limited, usually displayed as a single-line string in clients
Parameters:
-
magento_address_bind_ids
¶ One2many field; the value of such a field is the recordset of all the records in
comodel_name
such that the fieldinverse_name
is equal to the current record.Parameters: - comodel_name – name of the target model (string)
- inverse_name – name of the inverse
Many2one
field incomodel_name
(string) - domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False
) - limit – optional limit to use upon read (integer)
The attributes
comodel_name
andinverse_name
are mandatory except in the case of related fields or field extensions.
-
magento_bind_ids
¶ One2many field; the value of such a field is the recordset of all the records in
comodel_name
such that the fieldinverse_name
is equal to the current record.Parameters: - comodel_name – name of the target model (string)
- inverse_name – name of the inverse
Many2one
field incomodel_name
(string) - domain – an optional domain to set on candidate values on the client side (domain or string)
- context – an optional context to use on the client side when handling that field (dictionary)
- auto_join – whether JOINs are generated upon search through that
field (boolean, by default
False
) - limit – optional limit to use upon read (integer)
The attributes
comodel_name
andinverse_name
are mandatory except in the case of related fields or field extensions.
-