Odoo Help


This community 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.


Import partners with SQL : update ir_property table too ?

on 8/24/13, 10:31 AM 2,641 views

When I create a partner (company) within OpenERP, I've noticed that records are automatically created in ir_property table.

I'm looking to import partners through direct SQL insert queries, in the res_partner table.

Is it necessary to make inserts in the ir_property table too ?

If yes, could someone explain why ? And what is the purpose ?

Paul Ridley
On 8/24/13, 7:57 PM

Hi cd,

when customers are created in OpenERP the model res.users updates both tabel res.users and also tabel ir_property for a number of properties such as

  • property_payment_term -property_product_pricelist -property_delivery_carrier -many more... (see screenshot) image description

In order to ensure that the correct tabel in updated by any inserts/updates and deletes it is recommended that instead of directly updating a singele tabel with a SQL-statement that you instead utilise the OpenERP model itself. In this way you guarantee data integrity.

There are many methods to insert records using the OpenERP models for example: -program a script for it called XML/RPC -Use the inbuilt OpenERP csv import functionality -Use Talend which has available OpenERP connectors (my persona;l favourite)

hope this helps


Never use SQL to change data unless you know EXACTLY what you are doing - it can easily result in an inconsistent database. It bypasses all of the business logic and validation checks built in to the software. You should use XML-RPC if you want to script data imports.

Bista Solutions US, Ray Carnes
on 8/25/13, 3:20 AM
On 8/26/13, 6:54 PM

Thank you. But I would like to go further.

I would of course never use direct INSERT SQL queries for sales, invoices etc... but to import partners and products, at the setup of a new database, it would make sense to try, especially with thousands of references.

CSV and even XML-RPC imports are -unfortunatly- rather slow.

Some people seem to use SQL to import products, successfully (videos on youtube).

On a fresh DB install, I've noticed that if I choose a "chart of account", and then create a partner, the compulsory fields for the partner "account receivable" and "account payable" are automatically filled.

But OpenERP doesn't create records in ir_property table.

However, when I choose a payment term for a partner, or if i change the AR or AP accounts, then records are added into the ir_property table.

So i'm rather lost.

I believe it would be good for the community to have a clear understanding of the mechanism, regarding importation of products (the most important point) and partners, in order to know once and for all if a proper set of direct INSERT SQL queries could do the job.

You can understand the SQL used to create new partner records (including related records in the ir_property table) you should run the server with SQL logging enabled and watch what happens when you enter a record via the UI. See http://help.openerp.com/question/895/how-can-i-log-all-sql-queries-to-a-file/

Bista Solutions US, Ray Carnes
on 8/26/13, 9:17 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


Asked: 8/24/13, 10:31 AM
Seen: 2641 times
Last updated: 3/16/15, 8:10 AM