Book Image

Odoo Development Essentials

Book Image

Odoo Development Essentials

Overview of this book

Table of Contents (17 chapters)
Odoo Development Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Module data


Modules use data files to load their configurations into the database, initial data and demonstration data. This can be done using both CSV and XML files. For completeness, the YAML file format can also be used, but this is rarely used for data loading, so we won't be discussing it.

CSV files used by modules are exactly the same as those we have seen and used for the import feature. When using them in modules, the only additional restriction is that the file name must match the name of the model to which the data will be loaded.

A common example is security access, to load into the ir.model.access model. This is usually done using CSV files, and they should be named ir.model.access.csv.

Demonstration data

Odoo modules may install demo data. This is useful to provide usage examples for a module and data sets to be used in tests. It's considered good practice for modules to provide demonstration data. Demonstration data for a module is declared using the demo attribute of the __openerp__...