Invoice

class openerp.addons.magentoerpconnect.invoice.AccountInvoice(pool, cr)[source]

Bases: openerp.models.Model

Adds the one2many relation to the Magento bindings (magento_bind_ids)

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.invoice.AccountInvoiceAdapter(connector_env)[source]

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

Backend Adapter for the Magento Invoice

create(order_increment_id, items, comment, email, include_comment)[source]

Create a record on the external system

search_read(filters=None, order_id=None)[source]

Search records according to some criterias and returns their information

Parameters:order_id – ‘order_id’ field of the magento sale order, this is not the same field than ‘increment_id’
class openerp.addons.magentoerpconnect.invoice.MagentoAccountInvoice(pool, cr)[source]

Bases: openerp.models.Model

Binding Model for the Magento Invoice

magento_order_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.invoice.MagentoInvoiceExporter(connector_env)[source]

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

Export invoices to Magento

run(binding_id)[source]

Run the job to export the validated/paid invoice

openerp.addons.magentoerpconnect.invoice.MagentoInvoiceSynchronizer

alias of MagentoInvoiceExporter

openerp.addons.magentoerpconnect.invoice.delay_export_account_invoice(session, model_name, record_id, vals)[source]

Delay the job to export the magento invoice.

openerp.addons.magentoerpconnect.invoice.export_invoice(session, model_name, record_id)[source]

Export a validated or paid invoice.

openerp.addons.magentoerpconnect.invoice.export_invoice_paid(session, model_name, record_id)[source]

Deprecated in 2.1.0.dev0.

openerp.addons.magentoerpconnect.invoice.invoice_create_bindings(session, model_name, record_id)[source]

Create a magento.account.invoice record. This record will then be exported to Magento.