Loading data using XML files
In the previous recipe, we created the new book record with the external identifier book_cookbook
. In this recipe, we will add a different type of data from the XML file. We'll add a book and an author as demonstration data. We'll also add a well-known publisher as normal data in our module.
How to do it...
Follow the given steps to create two data XML files and link them in your __manifest__.py
file:
- Add a file called
data/demo.xml
to your manifest, in thedemo
section:Â Â Â Â 'demo': [ Â Â Â Â Â Â Â Â 'data/demo.xml', Â Â Â Â ],
- Add the following content to this file:
<odoo> Â Â Â Â <record id="author_pga" model="res.partner"> Â Â Â Â Â Â Â Â <field name="name">Parth Gajjar</field> Â Â Â Â </record> Â Â Â ...