Including default table data in install?

I’m wondering how I can do the equivalent of Fixtures, but for database data. i.e. Data I want inserted in the database during app installation.

For example: let’s say for ERPNext I wanted to include pre-defined Terms and Conditions, Territories, custom Roles, etc… so that are present with a fresh install.

How do I include this information to avoid manual importing?

You can use fixtures for this too (but they will be synced after every updated). Or you can write an after_install hook

1 Like