Setup wizard files in ERPNext

I see in erpnext/setup/setup_wizard/operations there are files named:

  • default_setup.py
  • install_fixtures.py

It seems these 2 files are used to pre-fill the default values for fields and settings. But some methods are duplicating between the two files.
And I can only see the links from setup_wizard is to the install_fixtures.py.
Even in hooks.py I don’t think I see default_setup.py is used (there is a call to install.after_insert, but nothing in install.py relates to default_setup.py)

  1. When and where is the default_setup.py used?
  2. If I want to add some defaults value, which file should I hook into?

Continuing my own post above.

I saw some (if not many) posts gruelling about setup wizard.
In my effort to add some default values, I open the setup wizard related files. And what I found is confusing, duplicated, scattered, spider-web codes and files doing this setup wizard.
Maybe this is the cause of stuck in finishing setup wizard, I don’t know.

There are files hanging around with unknown purpose, in setting up defaults lists and value there are like 3-4 ways of code/method to do similar things, orphaned method, mixed up with sample data (required for demo or because linked to other doctype?), some method calls from other data file but some are from within the same file, etc…etc.
And I think there are files from previous version setup wizard which are not used anymore in version 12.

So I suggest that this codes are relooked and rearranged to make it clear and perhaps easy on troubleshooting.

I disagree strongly about the description of confusing, duplicated, scattered, spider-web codes.

Frappe is true to its word that batteries are included.

  1. Customize those values in an existing site.
  2. Export those fixtures to a Custom App.
  • Check out how to export fixtures properly (you can find info in this forum), because you can export different customizations to different custom apps.
  1. Install the custom app to your site where you want to have those default values.

(When you see the pattern of the fixtures, you can code those values directly. But I find it must faster and reliable to simply have a site where I can do customization and export fixtures of these customized values)

Sorry if I gave wrong impressions.
I don’t mean the whole Frappe/ERPNext. I do believe and witness they are great products, having great codes, and very forward looking.
And I did mean good with my post. regarding the setup wizard.

So about the setup wizard. You can see that it perhaps during the updates it still have trace of previous versions left.
I make an Excel file of the structure as attached.

Yes thank you. I know how to do it by export fixtures. But there are lists I want to change the default as well. And it can’t be changed by export fixtures. Because export fixture will append (instead of change) the doc list from fixtures file to what has been set in the install process.
Even some require related value (e.g company name or parent tree) which is not available yet in a new site.

Regarding the setup wizard there are some files involved, with 2 primary files are:

  • install_fixture.py
  • defaults_setup.py

I think that defaults_setup.py is not used anymore (used in pre v12). Some methods are replicated (moved?) to install_fixture.py.
My first post seeks this confirmation.

1 Like

Thanks for the clarification.