I have a question, what is the relationship between a Doctype and its JSON file?
I have created a custom Doctype and, to define its design, I used a JSON file, but when I access said Doctype, I get errors like
Invalid Control Name in the layout.
I thought that the problem could be that the system not only uses the JSON file, but also uses the Doctype entry in
Setup > Customize > Doctype to define the layout.
Could someone guide me a little on this topic?
This JSON file is an exported format of the Database table that corresponds to your Doctype.
You don’t have to manually create any JSON files. System will create them.
If your doctype has
Is Custom checked on creation then no JSON file will be made. It will stay just in the Database.
Now the important things:
If you want to change something (add/rearrange/change property of field) in a
default ERPNext doctype, ALWAYS use only Customize Form or the Customize Option. If you wish to create a new document, create it with Edit Doctype but keep those changes in a seperate app.
Also if you do changes via Customize Form and don’t wish to lose them: then follow advice as mentioned here:
ERPNext provides Fixtures just for that.
You can directly export fixtures in ERPnext app, but those will be lost when you update or will show up as conflicts. Hence you create a new app and export those changes to that app which will remain untouched by ERPNext update routines.
Step One : Create new app (say new-app) and initialize a new git repo for this app.
Step Two : Find hooks.py file in your new-app folder
Step Three : Mention which DocT…
Thank you very much for the information
The problem is that I do not know the Git commands to manage different versions of ERPNext.
Do you mean that these JSON files are present in the ERPNext directory from the terminal?
I can not uncheck that option when creating a custom Doctype.
Don’t worry you can take a git tutorial. It is simple and you can learn.
As far as ERPNext/Frappe is concerned I will tell you a few basics that you should know:
Branch is a version of the application. Now you must be hearing master branch or develop branch or staging etc. etc.
master - the stable version of the app. This is is the branch your production server should be running on.
develop - the experimental version of the app containing features that may feature in upcoming versions.
They are automatically created when you create a doctype or report from the UI. The devs have taken care of that already.
It means your site is not in
To set it right execute this command:
bench --site your_current_site set-config developer_mode 1
To know what is your current site is:
Open frappe-bench folder, go to sites folder
There will be a textfile - currentsite.txt
The name mentioned in that text file is the current site name
Thank you very much for your help
I am currently taking several Git tutorials and getting used to its different branches.
I needed this kind of information to understand Git and understand how to develop a little better ERPNext