Enable Dark Mode!
how-to-load-demo-data-in-odoo-19.jpg
By: Swaraj R

How to load demo data in Odoo 19

Technical Odoo 19 Odoo Enterprises Odoo Community

When building an Odoo module, demo data is like the seasoning in your favorite dish; it’s not essential for production, but it makes development and testing so much more flavorful. Loading demo data helps you simulate real-world scenarios, test workflows, and impress stakeholders with a working preview of your app.

In this guide, we’ll walk through loading demo data in Odoo 19 step-by-step — including the manifest, XML, and CSV examples. By the end, you’ll have a working demo setup for your custom module.

Step 1: Preparing Your Module Structure

First, let’s set up a basic custom module. The structure should look like this:

+-- __init__.py
+-- __manifest__.py
+-- models/
¦   +-- __init__.py
¦   +-- my_model.py
+-- demo/
¦   +-- demo_data.xml
¦   +-- demo_records.csv

We’ll use both XML and CSV demo data formats to illustrate different use cases.

Step 2: Configuring the Manifest File

The manifest (__manifest__.py) is where you tell Odoo about your demo files.

Here’s an example:

{
    'name': 'My Demo Module',
    'version': '19.0.1.0.0',
    'summary': 'Module with demo data for Odoo 19',
    'author': 'Your Name',
    'depends': ['base'],
    'data': [
    ],
    'demo': [
        'demo/demo_data.xml',
        'demo/demo_records.csv
    ],
    'installable': True,
    'application': False,
}

Note: Files listed under demo are only loaded when demo data is enabled during database creation or module installation.

Step 3: Creating Demo Data in XML

XML is great for creating structured demo data with more control over relationships.

Example: demo/demo_data.xml

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <record id="demo_partner_1" model="res.partner">
        <field name="name">Demo Partner One</field>
        <field name="email">partner1@example.com</field>
    </record>
    <record id="demo_partner_2" model="res.partner">
        <field name="name">Demo Partner Two</field>
        <field name="email">partner2@example.com</field>
    </record>
</odoo>

Here we’ve created two demo partners that will appear in the Contacts app once the module is installed with demo data enabled.

Step 4: Creating Demo Data in CSV

CSV is ideal for loading multiple records in a clean, tabular format.

Example: demo/demo_records.csv

id,name,email
demo_partner_3,Demo Partner Three,partner3@example.com
demo_partner_4,Demo Partner Four,partner4@example.com

This will create additional demo contacts, much like the XML example — but in bulk-friendly CSV format.

Step 5: Enabling Demo Data

Demo data will only load if:

  1. Demo data is enabled when creating your database, OR
  2. You install the module after enabling demo data in developer mode (Odoo Settings > Activate Developer Mode > Load Demo Data).

If your demo data isn’t showing, confirm that demo loading was enabled at the database level.

Conclusion: Make Your Module Speak with Data

Adding demo data in Odoo 19 isn’t just about filling empty screens; it’s about showcasing your module’s capabilities, speeding up development, and making testing effortless. Whether using XML for relational complexity or CSV for clean bulk entries, the process is straightforward once you know where to put each piece.

So next time you’re building an Odoo module, don’t let it sit silent. Give it a voice with meaningful demo data, and let your stakeholders interact with a lively, working prototype from day one.

To read more about How to Load Demo Data in Odoo 18, refer to our blog How to Load Demo Data in Odoo 18.


If you need any assistance in odoo, we are online, please chat with us.



0
Comments



Leave a comment



whatsapp_icon
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message