What's the differences between patch and after_install?

I want to add some fields to some doctypes after installing a app, so I wrote some codes to do the changes.
Where should I put these codes? in after_install or in patch.


  • take fixtures of your fields (considering those are custom fields), frappe will create these fields after app install.
1 Like

If you want to add those fields in standard existing doctypes, then you should use Fixtures. In that way, you should be able to add extra custom fields anytime later as well. and it will be applied on bench update.