What is the best way to setup custom features in an erpnext project

In order to add customizations such as new fields for already existing DocTypes, should I create a new custom app to implement this?
If yes is there a way to make sure my custom app is depending on erpnext as a dependency or is this setup for me by the framework?

It depends on the project you are currently working in or in the site schema. The less invasive way to customize an existing doctype is through Customizing . If you create a custom app and therefore a module, you can export customizations into that module so you keep them separated.
The only thing you to do is installing your custom app in the given site but make sure to install erpnext too in that site if your customizations are based on erpnext doctypes.

1 Like

Thanks Bradley, under Customizing once I have modified the Doctype how can I make those changes visible to git within the app’s repository for example
running $ git status within the app directory and seeing modified files as a result of my customizations. I

Inside Customize Form of the form you want to make those changes visible for git => Actions => Export Customizations.
Now if you run git status again, you’ll see that a folder called “custom” has been created inside you custom app’s structure. This folder will contain the json files where your doctype customizations are stored.

1 Like

Is this the same procedure I should follow if I customized(edited) the Doctype instead of using the customize form?

If you edit frappe/erpnext doctypes, these changes won’t persist when updating frappe/erpnext.
If you are editing your own created doctypes, the changes you make will affect the doctype structure, therefore if you are using the same doctype in different sites these changes will affect all the sites where this doctype is present.
In a nutshell, customizing is less invasive than editing and allows you to keep different versions of a same doctype for each site.

1 Like

Hi Bradley, under exporting customizations is the module we select the one in which we have made changes? and if so how does erpnext know which custom app to export them to in case I have multiple custom apps ?

The changes will be exported into the module you select when exporting the customizations, no matter en which module are the changes made (e.g. I customize the doctype Opportunity by adding one extra field, then I update it, and after that I export customizations into the module that belongs to my custom app; a json file called opportunity.json is generated into mi custom apps’s folder “custom”). Each custom app generates one module with the name of the app, so you’ll have to choose the corrresponding one.
Let’s assume your app is called “CustomApp Generator”, you’ll have a module called CustomApp Generator that you’ll select when exporting the customizations you made in the Opportunity doctype.