Fixtures...don't know what it is

  1. Create new app e.g. - bench get-app library_management
  2. Install new app into your site e.g. - bench --site erpnext.vm install-app library_management
  3. Customize your form and ensure that the module name is changed to your app name e.g. - library_management
  4. Open file hooks.py using a text editor, such as “vi” from the location e.g. - ~/frappe-bench/apps/library_management/library_management/hooks.py
  5. At the end of the hooks.py file you can add line
    fixtures = [“Custom Field”]
    I would also add other usual customizations such as “DocType”, “Custom Script”, “Property Setter”, “Print Format”.
    I can also use the same technique to add all setups that are done so that migrating setups from test to production and vice versa is easy.
  6. Run command “bench --site mysite export-fixtures” to export all mysite customizations where you have selected Module name as your app name e.g. - library_management. The *.json files will be stored in the location ~/frappe-bench/apps/library_management/library_management/fixtures.

I haven’t tried using github yet but have read that one could upload the changes on github, or as I did, you can download those json files and put it into another system that has the same app created, into the same fixtures folder and use bench --migrate to apply the customization onto those sites that has the application installed.

hth

16 Likes