Book Image

Odoo Development Essentials

Book Image

Odoo Development Essentials

Overview of this book

Table of Contents (17 chapters)
Odoo Development Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

XML data files


While CSV files provide a simple and compact format to serialize data, XML files are more powerful and give more control over the loading process.

We have already used XML data files in the previous chapters. The user interface components, such as views and menu items, are in fact records stored in system models. The XML files in the modules are a means used to load those records into the server.

To showcase this, we will add a second data file to the todo_user module, named todo_data.xml, with the following content:

<?xml version="1.0"?>
<openerp>
  <data>
    <!-- Data to load -->
    <record model="todo.task" id="todo_task_c">
      <field name="name">Reinstall Odoo</field>
      <field name="user_id" ref="base.user_root" />
      <field name="date_deadline">2015-01-30</field>
    </record>
  </data>
</openerp>

This XML is equivalent to the CSV data file we have just seen in the previous section.

XML...