Changes made in json files are not loaded into database

I modified item.json file to show in item list view Total Projected Qty. I tryied running bench update and bench migrate to load changes in database but when I open list view I don’t see the change. I have developer mode enabled.

Which is the right way to load changes into database?

I need to make the changes directly in .json files instead of using the form customization because I have to upload these changes to a server and I want to sync changes automatically

Hello @jcgardey,

Have you tried running bench clear-cache then running bench migrate?
By the way, do you have a custom app installed to your site? If you did, you can edit Item list view through Customize Form. If haven’t already, add the fixtures array at the end of your custom app’s hooks.py file:

fixtures = ["Custom Field", "Custom Script", "Property Setter", "Print Format", "Report", "Workflow", "Workflow State", "Workflow Action"]

Afterwards, run bench export-fixtures or bench --site your_site_name export-fixtures. This will generate files which will contain the customizations that you made for custom fields, custom scripts, etc. Pick the right file and push it order once you’re satisfied with the result. The changes will only apply once the fixture file has been uploaded/pushed to your server.

Edit: These changes should be done on your local computer and not the server. :slight_smile:

Cheers,
Hera

2 Likes

I tried bench clear-cache and then bench migrate but did not work. haven’t got a custom app installed, I make changes directly on erpnext.

I want to customize erpnext by code. Make the changes through Customize Form and then export modifications to files in my opinion is tedious. As I understand, bench migrate should load changes in database.

Thanks for the reply.

Hello @littlehera

If I did changes to the json file, it is not building the field in the database and doctype until I do the export-fixtures?

Another thing: what is the command to push the fixture file and where it should be pushed?

Hello @jcgardey
How did you resolve the problem?

Regards
Bilal

hello @bghayad,

What .json file are you updating? If this is a doctype .json File, saving and running bench migrate should reflect the .json changes to your UI. But if not, you might need to run bench build or you might need to restart the server and/or clear your browser cache.

If you are working with a custom app, bench --site sitename export-fixtures exports a json file for each fixture declared in your hooks.py file and bench migrate SHOULD load the changes into the database. This is usually done if you’re developing an app (linked to a git repo) in your laptop/pc and you’re planning to push and apply changes in your production server.

If you don’t execute the export-fixtures command in your bench, Custom Fields/Custom Scripts/Customize Form changes, etc. should be stored in your database by default. If the changes aren’t building, you might want to:

  1. Run bench migrate after saving the changes to the json file.
  2. Clearing your browser cache and rebooting the server.
  3. Check the Property Setter list (you should be logged in as Administrator in Frappe/ERPnext) for any properties that conflict with the changes you did in the json file.
  4. Run bench clear-cache (to clear cache), bench build (to reload js files)

Cheers,

Hera