Importing products into Odoo from Legacy systems in bulk

Importing product category, image, stock quantity on hand, price buy/sell, etc

Christopher Simpson

Taking thousands of products from a legacy system & importing them neatly into Odoo

How hard can it be?

This is a very raw account of the process and hurdles experienced, (and overcome) whilst importing a few thousand products from a legacy sytem into Odoo version 8. 

It goes through the learning curve experienced in becoming more familier with Odoo, and looking at its history of being called TinyERP, and OpenERP. Additionally, we peek into working with Postgres to interface with Odoos database where helpful.

The story end with the 0.1 release of a Mamut export script (the legacy system from which the data is exported) which automates much of the process of exporting product data from Mamut. The code can be reused, and would need to be refactored heavliy for it to become a generic migration script. 

What is this Odoo thing anyway?

Odoo, it seems to us, is a little known application which allows businesses to manage their stocks, point-of-sale, eccomernece and soforth in a modular fahsion. That is, you don't have to install ecommerce if all you need is a point of save and vise versa.
The project, which used to be called OpenErp hasn't really made waves in the UK it seems (barely anybody I've spoke to has heard of it). It's not clear why, however, becuase our initial review of it left us very impressed albeit confused with its mixed message approach to opensource. This perhaps explains its weak positioning in the UK market at the moment, there are plenty proprietary competing services out there: SAP systems, EPSON, HP

Worth Watching

We encourage you to watch YBO's excellent video on Warehouse Management: https://www.youtube.com/watch?v=EkcztHYgJ3o to help grasp the concepts and processes involved with Odoos appraoch to warehouse and inventory management. 
 Additionally, review 'Importing and Exporting Data to and from Odoo V8' available here: https://www.youtube.com/watch?v=5VrVrHHmqpw

What are we trying to achieve?

We want to import the following information about each product into the Odoo's database:
  • Product name
  • Description
  • SKU
  • Price buy
  • Price sell
  • Product category for
    • POS module
    • Warehouse module
    • Ecommerce module

Getting the data out: XML & TSQL export. 

After performing a complete product export from Mauut in XML format the follow structure is revealed:
<xml>
</xml>

Getting the data in (part 1)

Double Entry Stock Stock Keeping

Its important to understand that Odoo uses double entry stock keeping. Much in the same way that accountancy packages do doule entry bookeeping(every entry into an account requires a corresponding exit). This can be confusing at first, as it required you to import new products from 'Virtual locations' in order for Odoo to do complete journaling of stock. Odoo then "calculates stocks for all of the physical locations" (docs). 

Virtual stock locations also come into play when orders are being processes. For example, it is possible that your virual stock level is less then your physical inventory when you have orders that have not yet been shipped. This is useful for a buying manager to decide whether to replenish stock, for example. In the same light, should you have a shipment scheduled to deliver more product to the warehouse, it is possible for your Virtual inventory to be higher than your physical inventory. Virtual inventory stock levels esesstial equiate to answering the question "What puantity of product could potentially sell right now with current stock levels, including scheduled shipments minus items already sold?".

Note: Mass Editing Module does not work for quanity on hand for initial import.

References & Useful links

Importing

Recording Anual Inventory

Recording initial inventory (wrong Openerp version) https://www.odoo.com/forum/how-to/warehouse-management-6/how-can-i-record-my-initial-inventory-55257
How to record anual inventory: https://www.odoo.com/forum/how-to/warehouse-management-6/how-can-i-record-my-annual-inventory-55267 
This explaination led to the understanding of how to force Odoo to generate the product_product external ids when importing inventory changes for the first time.  https://www.odoo.com/forum/help-1/question/how-can-i-record-my-annual-inventory-55267
Managing multiple unit of measures:
http://acespritechblog.com/2012/09/24/how-uom-unit-of-measure-works-in-openerp/
Crap sugestions:
  • Step by step with spreadsheet example: http://stackoverflow.com/questions/26104971/importing-qoh-in-odoo-8 
  • Guy who had sucess changing product_product to product_template https://www.odoo.com/forum/help-1/question/importing-csv-inventory-in-odoo-8-64344
  • http://stackoverflow.com/questions/29671399/how-to-import-qoh-in-odoo-8