Skip to Content
Odoo Development Cookbook
book

Odoo Development Cookbook

by Holger Brunn, Alexandre Fayolle, Daniel Reis
April 2016
Beginner to intermediate content levelBeginner to intermediate
400 pages
9h 16m
English
Packt Publishing
Content preview from Odoo Development Cookbook

Using external IDs and namespaces

There was a lot of talk about XML IDs already, without specifying what an XML ID is. This recipe will give a deeper understanding of this.

How to do it...

We write into already existing records to demonstrate how to use cross module references:

  1. Add a data file to your module manifest:
        'data': [
            'data/res_partner.xml',
        ],
  2. Change the name of our main company:
    <record id="base.main_company" model="res.company">
        <field name="name">Packt publishing</field>
    </record>
  3. Set our main company's partner as publisher:
    <record id="book_cookbook" model="library.book">
        <field name="publisher_id" ref="base.main_partner" />
    </record>

On installation of this module, the company will be renamed and the book from the next recipe will be assigned ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Odoo Development Cookbook - Fifth Edition

Odoo Development Cookbook - Fifth Edition

Husen Daudi, Jay Vora, Parth Gajjar, Alexandre Fayolle, Holger Brunn, Daniel Reis
Odoo 14 Development Cookbook - Fourth Edition

Odoo 14 Development Cookbook - Fourth Edition

Parth Gajjar, Alexandre Fayolle, Holger Brunn, Daniel Reis
Odoo 12 Development Cookbook - Third Edition

Odoo 12 Development Cookbook - Third Edition

Parth Gajjar, Alexandre Fayolle, Holger Brunn, Daniel Reis

Publisher Resources

ISBN: 9781785883644Supplemental Content