First of all, sorry for the wall of text.
I am learning frappe app development right now and was wondering how to extend existing DocTypes, e.g. Sales Invoice, via a custom app.
There are two articles regarding this in frappe app development documentation, but I still do not get the whole thing or which method is right one or do they both have their place.
- First way is to “Customize Form” the DocType and then export the customization to a Module of an app.
I get that, but does it mean when I install the app on another instance those customizations will be applied to that instance? What about conflict with other apps that maybe customized the same DocType using the same DocField names etc.?
I also do not get the last sentence in that Documentation: When you do bench update or bench migrate these customizations will be synced to the app. What does it mean “synced to the app”. I would export the customization to the app anyway via the export function in customize Form. Why should it get synced? What exactly is getting synced to where?
- Then there is Create Custom Fields During App Installation
It also says that once can add Custom Fields to DocTypes outside of your app when it is installed to a new site. To do this, add the new custom fields that your app requires, using the Frappe web application.
Do they mean modify the DocType directly? If yes, let’s say I open “Sales Invoice” DocType and add another DocField. Where can/is this field referenced to my custom app? It says one needs to add fixtures = [“Custom Field”] in hooks.py and then export those fixtures via bench command to the app.
All in all, what are fixtures exactly. Are they the custom DocFields one adds to the DocType? Or should I never change DocTypes not related to the app directly, but only via customize form as described in point 1?
Or does point 2 build on point 1?
Sorry for the wall of text, but I still do not grasp the process fully. Would be nice if someone could clarify a bit. Thanks.