Extending GarmentFlow
GarmentFlow ships with an opinion about how a garment factory runs. Your factory will differ somewhere — a field you need that isn't there, a document you print that we don't, a report your accountant asks for every month, a machine or a system you want to feed data into.
This section shows you how to add those things yourself, without forking the product and without breaking your next update.
Who this is for
Anyone administering a GarmentFlow site. Most of what follows needs no programming at all — you fill in forms in the interface. Two pages need a little JavaScript or Python, and one needs a developer if you want a mobile app at the end of it.
Each page assumes you know nothing beyond how to log in and find things, and walks the whole way through.
The one rule
Never edit GarmentFlow's own files. Not the DocType JSON, not the Python, not the JavaScript. An update overwrites them, and your change disappears — usually at the worst moment.
Everything in this section works differently: your changes are stored as data in your site's database, in records like Custom Field, Property Setter, Client Script, Print Format and Report. Updates replace GarmentFlow's code and leave your records alone.
That is the whole reason to do it this way rather than "just editing the file".
Choosing a tool
Work down this list and stop at the first row that solves your problem. The further down you go, the more it costs to build and maintain.
| You want to… | Use | Code needed |
|---|---|---|
| Add a field, hide a field, change a label, reorder columns | Extending forms | None |
| Work out which type a new field should be | Field types | None |
| Store a new kind of record | Creating DocTypes | None |
| Change what the form does as someone types | Client scripts | A little JavaScript |
| Enforce a rule, or act when a document is saved | Server scripts | A little Python |
| Print a document your way | Print documents | None, or Jinja for complex layouts |
| Answer a recurring question with data | Creating reports | None, or SQL/Python for complex ones |
| Email or alert someone when something happens | Configuring notifications | None |
| Connect another system, or build your own app | API & integrations | Depends on what you build |
Before you start
Two things worth doing once:
Give yourself the right role. Most of this needs System Manager. Customizing forms, writing scripts and creating DocTypes are all administrator-level actions, and they should stay that way — a mistake here affects everyone on the site.
Work on a test site first if you have one. Frappe Cloud can clone your production site to a staging one. Build the customization there, confirm it does what you want, then repeat it on production. For a single custom field this is overkill; for a server script that blocks a save, it is not.
The pages
- Creating DocTypes — a new kind of record, with its own form, list, permissions and API.
- Extending forms — add and hide fields and columns on the forms GarmentFlow already has.
- Client scripts — make a form react as it is filled in.
- Server scripts — enforce rules and automate on the server.
- Print documents — your own printed layouts.
- Creating reports — from a saved list view to a full script report.
- Configuring notifications — email and alerts on events and dates.
- API & integrations — read and write GarmentFlow from anything else, including your own mobile app or Power BI.
Two references to keep open while you work:
- Field types — every field type, what it is for, and how to configure it. Used by steps 1 and 2.
- Architecture — how the pieces fit, and why the approach above survives updates.
When to stop and write an app
Everything here lives on your site. That is a strength — it is quick, and it needs no deployment — and a limit: site customizations can't be version-controlled in git, code-reviewed, or moved between sites except by export.
Once your customizations become substantial — dozens of scripts, or logic that several sites need to share — the right answer is a custom Frappe app installed alongside GarmentFlow. That is a developer's job, and it is out of scope here, but the boundary is worth knowing before you cross it by accident.
What to do next
If you're not sure where your problem fits, start with Extending forms — it solves more real requests than everything else on this list put together.