Install custom app with data

When I install my custom app t new site how can I also install the data, that is some records should be created as we get in erpnext?

1 Like

You can export then as fixtures!

https://frappe.io/docs/user/en/guides/app-development/how-to-create-custom-fields-during-app-installation

There is not much explanation and I have to add data to an existing doctype for example I need that when I install my app there should be a new record in “leave type” doctype. How can this be done with fixtures?

Get fixtures for that doctype! So while installing app on another site system will create those records.

Can you give an example as to how? Because there is nothing that I can understand from the link above

  1. Goto hooks.py in your app
  2. Add key fixtures in hooks.py
fixtures = ["DOCUMENT_NAME"]
  1. Save the file
  2. Goto console
bench --site your_site export-fixtures
2 Likes

Working, Thankyou so much