Loading data using XML files
In the previous tutorial, we created the new room record with the hostel_room_1
external identifier. In this tutorial, we will add a different type of data from the XML file. We’ll add a room and an author as demonstration data. We’ll also add a well-known publisher as normal data to our module.
How to do it...
Follow the following 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="member_hda" model="res.partner"> <field name="name">Husen Daudi</field> </record> <record id="member_jvo" model="res.partner"> <field name="name">Jay Vora</field> </record> <record id="hostel_room_1" model="hostel...