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.


parent_id field (XML-RPC)

on 2/27/13, 7:08 AM 2,766 views

I'm importing Customers via XML-RPC from an external database, which has realationship with the companies inside openerp. I'm wishing to put those companies parent_id, so i set the parent_id to: [ 'id_of_the_parent_company', 'name_of_the_parent_company'] and the XML-RCP accepts this. Yet i dont see any result inside OpenERP.

What am I doing wrong, or miss to do?


Andreas Brueckl

--Andreas Brueckl--
| 7 8 7
Vienna, Austria
--Andreas Brueckl--
OpenERP Consulting and Development
Andreas Brueckl
On 2/27/13, 7:52 AM

try to use the following syntax to set the company for a customer:

{'parent_id': <id-of-customer/company>}

The ID must be a database ID of an entry of the model res.partner. If there exists an entry of res.partner with DB-ID 5 you can write:

{'parent_id': 5}

(I assume that you are using the write-method of XMLRPC)

There is also another field in the customer object: company_id, if you want to set the related company for the customer. Be aware of the difference between a customer/company and the OpenERP company (your company).

Here is an example of how to use XMLRPC with python: https://accounts.openerp.com/forum/Help-1/question/711/

thanks for the answer, but ether {'parent_id': <id-of-customer/company>} this doesn't work or I'm doing it wrongly. Also it throwsa strange error when i try to use the company_id : xmlrpclib.Fault: <Fault warning -- Integrity Error . and all i did was give the company_id the id of the company.

on 3/13/13, 6:23 AM

I have updated my answer. If this does not work you should check your XMLRPC call.

Andreas Brueckl
on 3/14/13, 5:16 AM

{'parent_id': 5} is the correct one thank you. And a college of mine noticed an error in my code, which resulted that the parent id was never updated. ( used the wrong variable.) THank you nonteless

on 3/18/13, 5:29 AM

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: 2/27/13, 7:08 AM
Seen: 2766 times
Last updated: 3/16/15, 8:10 AM