Create Sale Orders in Magento

Sales orders in Magento can created from Magento Admin Panel with Create New Button shown in below Create New Order screenshot.

Sale in Magento


Orders in Magento


How it Works

This section explains how import and export of orders between OpenERP and Magento works.


All the data represented below is demo data and is only for demonstration purposes.

Orders are imported as Sales

Orders placed in Magento Admin Panel are imported in OpenERP from Store View. See below:


An order in Magento has a number of entities related and they are imported in OpenERP as described below:

  • The Order is imported as a Sale. The sale in OpenERP can be identified by the Order Number which will be same as the order reference in Magento. Internally the matching is done using the ID of the order as returned by Magento.
  • The date on which it order is generated
  • The Customer who placed the order as a Sale.
  • The products, i.e., the products bought in the order by the customer are imported as Sale lines. The product in each of these lines is created as product in OpenERP, if it does not already exist.

A window pop-ups to import all sale orders placed on this store view. Enter Continue, refer screenshot shown below:


Order imported as Sales in OpenERP

Sales >> Sales Orders


When the order import happens next time, the status of the orders in state in OpenERP will be updated if there is a change in state on Magento.

Product in OpenERP


The products bought in the order by the customer are imported. The product in each of the sale lines is created as product in OpenERP, if it does not already exist.

Cancellation Of Sale Order

Double click on the order from the sale order lines to edit it. To cancel the order click Cancel Order button as shown in below screenshot:


Now state has been changed to cancelled, see below

Cancelled Sale Order


Now to export the changes to Magento, refer export order

Exporting Order Status from OpenERP to Magento

Once the order is processed in OpenERP, the shipping status of the order based on delivery is updated on Magento by Export Order.


This will export order’s status to magento for this store view

  • The status of orders which are imported in OpenERP will be exported to Magento as Cancelled once they are marked Cancelled by editing sale order from OpenERP.

Canceled order in Magento



This feature is currenctly available for Cancelled Orders

Handle Taxes When Importing Orders From Magento

Taxes are matched on openerp and magento using their rates. But there can be multiple taxes with same rates and hence lead to ambiguity. So a field is added to taxes in openerp which allows the user to tell the system that a tax can be used for rate matching with a tax on magento.

See screenshot below:


The corresponding tax on magento can be seen in screenshot below:


Now, when an order placed on magento with `Magento Tax`_ is imported to openerp, the `OpenERP Tax`_ will be applied on the corresponding sale line in openerp. If no matching tax is found, then no tax is applied and a user can apply taxes if needed, later.


This feature works only for simple products as of now.

Handle Taxes On Shipping

Handling of taxes on shipping need an extra bit of configuration to be done. Tax on shipping has to be set as tax included in price because magento does not send the tax on shipping as a rate and calculating the rate from the amount almost always leads to mismatch of order totals due to rounding issues. Hence, the tax on shipping is set to be included in price to make sure order totals match and tax calculation done by openerp is assumed to be as close as possible to the tax calculation done by magento. See screenshot below:


Here details need to be set as highlighted in screenshot.


Make sure that only one tax has been set to be applied on magento shipping.