Hi everyone,
I’ve been experimenting with the Frappe framework custom apps, and it’s working well for what I need, but I also need to use ERPNext. I have a big question that might be somewhat obvious, but I haven’t found any information that helps solve my issue.
I have a repository with the code created after running:
bench init frappe-bench
And also with the code generated by:
bench get-app erpnext
The apps/frappe
and apps/erpnext
folders are essentially Git repositories. When I try to merge everything into a single repository, it doesn’t work, because it detects those folders as submodules, I need to make some changes to ERPNext, so having it as a separate repository isn’t ideal for me.
I’ve tried removing the .git
and .github
folders from the apps, but when I rebuild the project, I get multiple errors.
Is there a recommended way to achieve this? Or are there any alternatives? A lot of the documentation seems focused on custom apps or implementing ERPNext without modifications.
Thanks in advance!
“Modifications” to ERPNext or any other app that’s not maintained by you should be done via hooks and custom fields - these customizations should be a part of your custom app.
The custom app and ERPNext shouldn’t be in the same repository - nor should you change code directly within the ERPNext codebase because you’ll lose out on any updates that ERPNext makes.
Basically, just use hooks and custom fields to modify existing logic - and only do it if it’s needed.
1 Like
Thank you so much for taking the time to respond. I understand the part about not modifying ERPNext directly and using hooks and custom fields. However, what I’m still not clear on is how I can manage a repository for my sites.
Let’s say I have a site with ERPNext, Frappe, and my custom app installed—how can I turn that into a repository that can be cloned and set up on other instances?
Should I turn the apps
folders into Git submodules and then push? Or is there a bench
command to install them again?
For that you may look into frappe docker and setting up your own docker image. An easier solution would be to setup the repo of your custom app only, create a script that installs specific versions of frappe and erpnext on your new instance along with your custom app. Any changes you do, you do it through your custom app, and those will be applied to any instance you update your custom app.
If you’re on FC, this is very easy - you just need to set up a “Bench Group” with the apps you want and you can create multiple sites under that bench group.