- "git" things to know
- create app's git repo
- create fork repo
- create feature branch
- send, approve and accept merge request
- git tags, prepare release script.
- push release to HEAD branch, e.g version-13, version-12, etc.
- docker
- docker post-installation steps on Linux
- docker-compose
- Visual Studio Code
- VS Code remote container
Easiest way to start development bench is using frappe_docker VS Code devcontainer Read more about Development Setup
Why docker? Setting up bench on various distributions natively may be difficult, mac os native bench also requires set of steps unique to Apple device. Windows is not natively supported.
In case if docker is already installed, the steps to start and setup more or less remain same across all above operating systems.
Docker on non linux OS requires VM to run, Allocate sufficient RAM for the vm that runs docker.
In case of windows, using WSL or WSL2 for docker desktop is recommended. HyperV cannot publish ports on host machine. HyperV publishes ports on VM IP.
Certain features are blocked from UI for production mode. These features are only available once developer_mode is enabled. DO NOT enable developer_mode on production machines.
Once developer mode is enabled the framework can generate and modify the source files in frappe framework apps. e.g. If Standard Report is added under a module, a directory and set of files are created under that module in the app where module is located. In case user adds Standard Report in frappe or erpnext module, it will create files in frappe or erpnext source tree. This will make the production system non-upgradable unless the unstaged git change are committed or removed.
In case of development environment, the files are committed and pushed on the a repository by developer where further pipeline is triggered.
Use the bench new-app command, for details use the cli help bench new-app --help. Bench Development Command
from frappe-bench directory
bench --site site.local install-app custom_appFrom Awesome Bar: new DocType
Refer https://frappeframework.com/docs/user/en/basics/doctypes
Refer https://frappeframework.com/docs/user/en/basics/doctypes/naming
Refer https://frappeframework.com/docs/user/en/basics/doctypes/controllers#controller-methods
Refer https://frappeframework.com/docs/user/en/desk/scripting/client-script
In case of custom app, do not use Custom Script DocType. Use hooks.py and place the file in public/js directory of custom app :
doctype_js = {
"Customer" : "public/js/custom_customer.js",
}DO NOT export all fixtures, always filter for each app. e.g.
fixtures = [
{
"dt": "Custom Field",
"filters": [
[
"name",
"in",
[
"Delivery Note Item-xcustom_serials",
"Customer-xcustom_customer_bin_id",
],
],
]
},
]Query Report: https://frappeframework.com/docs/user/en/guides/reports-and-printing/how-to-make-query-report Script Report: https://frappeframework.com/docs/user/en/guides/reports-and-printing/how-to-make-script-reports
Create a python module and write a function to schedule and mention it in hooks.py:
scheduler_events = {
"hourly_long": ["custom_app.schedules.purchase.process_purchase_orders"]
}Custom App : https://frappeframework.com/docs/user/en/guides/integration/rest_api#rpc Without Custom App: https://frappeframework.com/docs/user/en/desk/scripting/server-script
Build latest tagged images on push to main branch.
Use Release script to tag versions once users approve latest tag.
Refer :
- Sample app (posawesome) https://discuss.erpnext.com/t/docker-app-installation/72904/9
- Gitlab Build Pipeline https://gitlab.com/castlecraft/excel_erpnext/-/blob/version-12/.gitlab-ci.yml
- docker related files https://gitlab.com/castlecraft/excel_erpnext/-/tree/version-12/docker
- release script: https://gitlab.com/castlecraft/excel_erpnext/-/blob/version-12/release.py
Place the release script in the root of your app.
execute following command from your custom app dir, e.g. frappe-bench/apps/custom_app
./release --help
usage: release.py [-h] [-d] [-j | -n | -p]
optional arguments:
-h, --help show this help message and exit
-d, --dry-run DO NOT make changes
-j, --major Release Major Version
-n, --minor Release Minor Version
-p, --patch Release Patch Version