Product Category

class openerp.addons.magentoerpconnect.product_category.MagentoProductCategory(pool, cr)[source]

Bases: openerp.models.Model

description

Very similar to Char but used for longer contents, does not have a size and usually displayed as a multiline text box.

Parameters:translate – whether the value of this field can be translated
magento_child_ids

One2many field; the value of such a field is the recordset of all the records in comodel_name such that the field inverse_name is equal to the current record.

Parameters:
  • comodel_name – name of the target model (string)
  • inverse_name – name of the inverse Many2one field in comodel_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 and inverse_name are mandatory except in the case of related fields or field extensions.

magento_parent_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.

class openerp.addons.magentoerpconnect.product_category.ProductCategory(pool, cr)[source]

Bases: openerp.models.Model

magento_bind_ids

One2many field; the value of such a field is the recordset of all the records in comodel_name such that the field inverse_name is equal to the current record.

Parameters:
  • comodel_name – name of the target model (string)
  • inverse_name – name of the inverse Many2one field in comodel_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 and inverse_name are mandatory except in the case of related fields or field extensions.

class openerp.addons.magentoerpconnect.product_category.ProductCategoryAdapter(connector_env)[source]

Bases: openerp.addons.magentoerpconnect.unit.backend_adapter.GenericAdapter

assign_product(categ_id, product_id, position=0)[source]
get_assigned_product(categ_id)[source]
move(categ_id, parent_id, after_categ_id=None)[source]
read(id, storeview_id=None, attributes=None)[source]

Returns the information of a record

Return type:dict
remove_product(categ_id, product_id)[source]
search(filters=None, from_date=None, to_date=None)[source]

Search records according to some criteria and return a list of ids

Return type:list
tree(parent_id=None, storeview_id=None)[source]

Returns a tree of product categories

Return type:dict
update_product(categ_id, product_id, position=0)[source]
openerp.addons.magentoerpconnect.product_category.ProductCategoryBatchImport

alias of openerp.addons.magentoerpconnect.product_category.ProductCategoryBatchImporter

class openerp.addons.magentoerpconnect.product_category.ProductCategoryBatchImporter(connector_env)[source]

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

Import the Magento Product Categories.

For every product category in the list, a delayed job is created. A priority is set on the jobs according to their level to rise the chance to have the top level categories imported first.

run(filters=None)[source]

Run the synchronization

openerp.addons.magentoerpconnect.product_category.ProductCategoryImport

alias of openerp.addons.magentoerpconnect.product_category.ProductCategoryImporter

class openerp.addons.magentoerpconnect.product_category.ProductCategoryImportMapper(connector_env)[source]

Bases: openerp.addons.connector.unit.mapper.ImportMapper

backend_id(record)[source]
direct = [('description', 'description')]
magento_id(record)[source]
name(record)[source]
parent_id(record)[source]
class openerp.addons.magentoerpconnect.product_category.ProductCategoryImporter(connector_env)[source]

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