A small plugin for Frappe that adds the support of customizations to the numerical controls.
- Frappe >= v12.0.0
Do not forget to replace [sitename] with the name of your site in all commands.
- Go to bench directory
cd ~/frappe-bench
- Get plugin from Github
(Required only once)
bench get-app https://github.com/kid1194/frappe-better-numerical-controls
- Build plugin
(Required only once)
bench build --app frappe_better_numerical_controls
- Install plugin on a specific site
bench --site [sitename] install-app frappe_better_numerical_controls
- Check the usage section below
- Go to app directory
cd ~/frappe-bench/apps/frappe_better_numerical_controls
- Get updates from Github
git pull
- Go to bench directory
cd ~/frappe-bench
- Build plugin
bench build --app frappe_better_numerical_controls
- Update a specific site
bench --site [sitename] migrate
- (Optional) Restart bench
bench restart
- Go to bench directory
cd ~/frappe-bench
- Uninstall plugin from a specific site
bench --site [sitename] uninstall-app frappe_better_numerical_controls
- Remove plugin from bench
bench remove-app frappe_better_numerical_controls
- (Optional) Restart bench
bench restart
- Go to Customization > Customize Form
- Enter the form type/name (Ex: 'User')
- Scroll down to the form fields area and create an Int, Float or Currency field or edit an existing custom field
- In the options property of the field, add a JSON object of the customizations you want. Example:
{"min": 10, "max": 100}
ℹ️ Note: You can't modify the original fields of a doctype, so create a new field or clone and modify the entire doctype.
Option | Description |
---|---|
min |
The minimum number allowed. - Example: -- Int: 10 -- Float: 10.5 |
max |
The maximum number allowed. - Example: -- Int: 100 -- Float: 100.5 |
divisible_by |
The number that the value must be divisible by. - Example: 5 |
min_field |
The name of the field that holds the minimum number allowed. - Example: min_price |
max_field |
The name of the field that holds the maximum number allowed. - Example: max_price |
The checking order is as follows: max_field, min_field, divisible_by, max, min.
- Int
- Float
- Currency
If you find bug in the plugin, please create a bug report and let us know about it.
This repository has been released under the MIT License.