Demonstration data

Odoo addon modules may install demonstration data, and it is considered good practice to do so. This is useful for providing usage examples for a module and datasets to be used in tests. Demonstration data for a module is declared using the demo attribute of the __manifest__.py manifest file. Just like the data attribute, it is a list of filenames with the corresponding relative paths inside the module.

We should add some demonstration data to our todo_user module. An easy way to do that is to export some data from the To-Do tasks, as explained in the previous section. The convention is to place data files in a data/ subdirectory. So, we should save these data files in the todo_app addon module as data/todo.task.csv. Since ...

Get Odoo 11 Development Essentials - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.