How to Manage Patches, Fields and Customization in Frappe

I have created some additional fields to Existing doctypes and same repo from git serves 2 separate instances.
When used Customize Form, the fields are not added to Doctype JSON, but updated in database tabcustom_fields, in this case the code in git repo wont get these new fields
How can we manage these in Frappe code ???

You can switch to developer mode by running bench set-config developer_mode 1 in your bench folder, then restart your bench and access your site again. At this point if you access the doctype you want to customize an “Edit Doctype” option should appear in the same menu you can access “Customize Form”.
If you make any changes by running this option (editing doctype), the structure of the doctype will be modified in the database. However, if you are modifying Frappe core doctypes, you won’t be able to access your changes via git serving different instances. Maybe developing a custom app would be a better option as you can manage it via git, but that would depend on the requirements of each particular case.

1 Like

Thanks @Bradley , creating Custom Apps is definitely a solution, but when I need to customize existing Doctype of ERPNext (e.g Sales Order or Employee), then these additional fields go in Database and the 2 instances run on different databases, and this is where I get Stuck. So how do i solve this?
is there any way where, I can add a code in frappe/ERPNext , and it creates a field in DB table and removes or Alters the field in DB table

Two Ways I know

either:

useing Fixtures

Or:

2 Likes

Maybe fixtures will work nicely in the scenario you’re describing. Check this out:
https://github.com/frappe/erpnext/wiki/Export-Custom-field-using-export-fixtures

1 Like

Thanks @amadhaji @Bradley
Exporting Customizations is a solution I was looking for.

Steps I followed:

  1. Creating new Custom Frappe App and installing it Parallel to ERPNext App on the same site
  2. Doing Customizations on the DocType of ERPNext through Customize Form
  3. Using the Export Customization option on the Customize Form, which creates a Custom Directory within the module of my new Custom Frappe App
  4. Saving and pushing the code to git
  5. Installing the same code to different machine on a different site, and after installation, running bench migrate command
4 Likes