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.


How to change the Your Company record with XML

Hendrik ten Hoor
on 1/3/14, 1:23 PM 3,736 views

I want to make an OpenERP-module which install my configuration. I'am able to add records to the database tables using XML-files in the datasection of __openererp___. However I want to change the "Your Company" record in the res_company table instead of add an new one to it. How can this be accomplisched using a XML-file ?



Atul Arvind

--Atul Arvind--
| 3 3 5
--Atul Arvind--


I am odoo Enthusiast/Consultant from Baroda, Gujarat, India. Working with odoo from v5 to v9 and other opensource technology since 4+ years. Having Strong Expertise in

Requirement gathering & Gap Analysis

Odoo Development

Odoo Customization

Odoo Training

Odoo Integration

Server Administration

Odoo Migration


I am also active on StackOverflow.


Atul Arvind
On 1/3/14, 3:34 PM

To update the record of company using the demo data you need to write a record in xml file like,

<record id="base.main_company" model="res.company">
    <field name="name">Your New Company</field>
    <field name="partner_id" ref="main_partner"/>
    <field name="rml_header1">Your New Company Tagline</field>
    <field name="currency_id" ref="base.EUR"/>

it will change the default company information while installing your customer module.

It seems that this technique does not work anymore in version 8.0. It seems that when you have a noupdate=1 in the module creating the data originally, it means "no update AND NO OVERRIDE".

Trobz, Jean-Charles Drubay
on 9/29/14, 11:33 PM

@Trobz, Jean-Charles Drubay Did you find a way in v8 ? My question here: https://www.odoo.com/fr_FR/forum/help-1/question/how-to-override-your-company-data-through-a-custom-module-in-v8-87510

on 7/1/15, 9:40 AM
Hendrik ten Hoor
On 1/3/14, 4:13 PM

Thanks for your answer. Now the record in the table res_company get updated nicely.

Only the line <field name="partner_id" ref="main_partner"/> seems redundant. In my case it generates an error since the id "main_partner" was not defined in the XML-file. However the corresponding record in the res_partner table got updated without that line as well. So is there a real need for it ?


Well, he forgot: base.main_partner About if it's neccesary or not it depends on you, because your res.partner it's going to stay with Your Company if I'm not wrong. But you can try it

GH Mediacloud, Grover Menacho
on 1/3/14, 4:25 PM

I have done some testing. It went oke because I started with a fresh database with only one company record and one partner record. So the field partner_id in the company record already had the correct value since there was only one record to choose from anyway :-) So it will be definitely better to explicitly set it in the xml-file.

Hendrik ten Hoor
on 1/3/14, 7:40 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

1 follower(s)


Asked: 1/3/14, 1:23 PM
Seen: 3736 times
Last updated: 3/30/15, 10:54 AM