I have created a module. this module have several doc type linked with it . Now I want to change the name of the module. Is there any specific way to do so?? Please suggest me .
Since the module name is the folder name too you will have to move all the doctype controllers (JS & PY) to the new module
Is it possible to rename a module without creating a new module ?
I just want to rename the module name .
how could do it for non frappe developers could you explain it with images, please?
How to Rename a Module in Frappe (Safely)
Renaming a module in Frappe requires updating both the UI and the source code to ensure consistency. Follow the steps below:
Step 1: Rename the Module from the Desk (UI)
- Go to the Module Def (Module Definition) from the Desk.
- Rename the module by clicking on the Rename option.
- When prompted, choose “Merge with existing” if a module with the new name already exists.
- Confirm the change.
Step 2: Rename the Module Folder in the Source Code
- Navigate to your app’s module folder, usually located at:
apps/[your_app]/[your_app]/[module_name]
- Rename the folder to match the new module name exactly (use snake_case).
attachments → parent_attachments
Step 3: Update Doctype Definitions
Each Doctype that was under the old module name must be updated to reflect the new module name:
- Go to:
apps/[your_app]/[your_app]/[new_module_name]/doctype/[doctype_name]/[doctype_name].json
- Open the
.json
file for each Doctype and look for the"module"
field. - Update the value to the new module name (as it appears in the system — Title Case).
"module": "Attachments" → "module": "Parent Attachments"
Step 4: Update modules.txt
- Open the
modules.txt
file located at:apps/[your_app]/[your_app]/modules.txt
- Ensure the new module name is listed in the file (Title Case).
- Remove the old module name to avoid errors like “Module not found”.
Notes
- After completing all steps, run:
bench build
bench clear-cache
bench migrate
- Restart your bench if necessary:
bench restart
Common Mistakes
- Mismatch between folder name (snake_case) and
"module"
field (Title Case). - Forgetting to update the
modules.txt
file. - Not updating all DocTypes that belong to the renamed module.
1 Like