Odoo Help


Using SQL via pgAdmin for importing - initial data

on 3/4/13, 12:58 PM 5,030 views

any guides for the minimum data required for initial setup.... we have 150,000 Sku so the CSV import tool is not robust enough.

for products it seems like 2 tables (product_template first then product-product) do i just need the not NULL fields populating ?

what about customers and procurement rules ?

Did you have a look to youtube ? There is a tutorial for importing products directly into postgresql. It helped me a lot.

on 3/14/13, 4:08 AM
Nicolas C
On 4/11/13, 5:07 PM


If you have "simple" object to import (ie: not a multi variant product like I try to do right now, see my thread if interested) then I suggest you to use some XML RPC tool to update the product list (but also customers, contacts, or others object when you will become familiar with XML RPC). This way you'll directly go thru the Controller of the MVC (Model Controller View) architecture of OpenERP and all data integrity (thru product.template model or others) will be checked/updated/...

For just importing "simple" products (name, ref, uom, price, ean13, ... ) it take around 30s on my ubuntu server (running as a VM on my laptop) for 5000 products from a cvs file (using my own perl script).

The only thing to prepare before if you want to only load product.product are : product.category => You have to define the category (name, parent, account,...) and get back the id to use them as part of the product.product model within categ_id field product.uom => you have to create required unit (ie: I need surface unit like cm² and have to create a Surface category then cm² unit part of Surface) and get back the id to use them as part of the product.product model within uom_id (default unit) and uom_po_id (unit for ordering if not same as default).

OpenERP Controller will update product.template itself you will not have to deal/bother with it (interesting isn't it ? :o) ).

Have a look to the OpenERP dev guide for more XML RPC exemples (I script in perl but work for any RPC XML capable language). h t t p : / / doc.openerp.com/v6.0/developer/6_22_XML-RPC_web_services

My "main" advice is that dealing with Controller of the OpenERP MCV is safer than dealing directly with PGSQL DB mainly as : - some model not always belong on a "one to one" with a table. - quite all "[many|one]2[many|one]" relations seems only to be defines within the Controller rules, not the pgSQL DB.

Hope this will help you.

@++ Nicolas

Thanks for the information. I agree XML-RPC is the safest way to go. This video goes along with what you've said: http://www.youtube.com/watch?v=goh6swXRYns (this company also has another video showing importing directly into PostgreSQL using SQL). The video also shows how you can use the developer mode to see what the database table, and field names are as you browse the UI.

James Earl
on 4/11/13, 6:05 PM

Developer mode is great (I used it every day in order to build my own perl XML RPC script) but I just discovered that running OpenERP server with "--debug --log-level=debug_rpc_answer" (be careful, quite verbose ^^) and then performing thru the web "what we expected to perform thru XML RPC" is just awsome !!! This way you more or less just have to identify the XML RPC action (select, read, write) made by the web client and "copy/past" the data structure to your script then fill the structure with your data (from CSV or elsewhere).

Nicolas C
on 4/11/13, 6:31 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 3/4/13, 12:58 PM
Seen: 5030 times
Last updated: 3/16/15, 8:10 AM