Book Image

Odoo Development Cookbook

By : Holger Brunn, Alexandre Fayolle, Daniel Reis
Book Image

Odoo Development Cookbook

By: Holger Brunn, Alexandre Fayolle, Daniel Reis

Overview of this book

Odoo is a full-featured open source ERP with a focus on extensibility. The flexibility and sustainability of open source is also a key selling point of Odoo. It is built on a powerful framework for rapid application development, both for back-end applications and front-end websites. The book starts by covering Odoo installation and administration, and provides a gentle introduction to application development. It then dives deep into several of the areas that an experienced developer will need to use. You’ll learn implement business logic, adapt the UI, and extend existing features.
Table of Contents (23 chapters)
Odoo Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Loading data using XML files


Using Chapter 4, Application Models data model, we'll add a book and an author as demonstration data, while we add a well known publisher as normal data in our module.

How to do it...

Create two XML files and link them in your __openerp__.py manifest file:

  1. Add in a file called data/demo.xml to your manifest, in the demo section:

        'demo': [
            'data/demo.xml',
        ],
  2. Add content to this file:

    <odoo>
        <record id="author_af" model="res.partner">
            <field name="name">Alexandre Fayolle</field>
        </record>
        <record id="author_dr" model="res.partner">
            <field name="name">Daniel Reis</field>
        </record>
        <record id="author_hb" model="res.partner">
            <field name="name">Holger Brunn</field>
        </record>
        <record id="book_cookbook" model="library.book">
            <field name="name">Odoo Cookbook</field>
            <field name="short_name"...