O'Reilly logo

Odoo Development Essentials by Daniel Reis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required