doctype-development

Create and modify Frappe DocTypes with controllers, child tables, naming series, and permissions.

62|23|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/lubusIN/frappe-skills --skill doctype-development-lubusin
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: doctype-development
Source: https://github.com/lubusIN/frappe-skills/tree/main/doctype-development
Command: npx skills add https://github.com/lubusIN/frappe-skills --skill doctype-development-lubusin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building data models in Frappe requires knowing DocType types, field configurations, controller lifecycle hooks, naming patterns, and permission rules—mistakes like wrong fieldtypes, missing migrate steps, or controller class name mismatches cause silent failures and broken schemas. ## Core Features & Use Cases - DocType Creation & Schema Design: Guides creation of standard, single, child table, submittable, tree, and virtual DocTypes with correct field types and JSON structure. - Controller Lifecycle Implementation: Provides patterns for validate, before_save, after_insert, on_submit, and other hooks with correct ordering and best practices. - Child Tables, Naming & Permissions: Covers parent-child table patterns, naming series formats, role permissions, and user permissions for row-level security. - Use Case: You need a submittable Sales Order DocType with an items child table, automatic naming like SO-2026-001, and role-based submit permissions—this Skill walks through each step with verified code patterns. ## Quick Start Create a new submittable DocType called Project Task with a child table for time entries, a naming series, and a validate controller hook.

Frequently Asked Questions about doctype-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a new DocType in Frappe?▼

Create a DocType via the Desk UI (DocType List > New) with developer mode enabled so it exports to your app, or write the JSON definition directly under <app>/<module>/doctype/<doctype_name>/. Then add a Python controller class and run bench migrate to apply the schema.

How do I add a child table to a Frappe DocType?▼

Create a child DocType with istable set to 1, then add a Table field to the parent DocType whose options point to the child DocType name. In the parent controller, iterate rows with for item in self.items and use self.append("items", {...}) to add rows.

Why is my Frappe DocType controller not being called?▼

The controller class name must be the PascalCase version of the DocType name, such as SalesOrder for "Sales Order", and the file must sit in doctype/<doctype_name>/<doctype_name>.py. Also confirm the app is installed on the site and restart bench after code changes.

Why are my DocType schema changes not appearing in the database?▼

Schema changes only apply after running bench --site <site> migrate. Also verify developer_mode is enabled in site config, since DocType edits only export to app files when developer_mode equals 1.

What naming series options does Frappe support for DocTypes?▼

Frappe supports field-based naming (field:fieldname), naming_series with date and counter patterns like ORD-.YYYY.-.###, format strings such as format:PRJ-{####}, hash for random names, Prompt for manual entry, and a custom autoname method in the controller.

When should I use a Virtual DocType in Frappe?▼

Use a Virtual DocType (is_virtual: 1) when data lives outside the Frappe database, such as external APIs, secondary databases, or JSON/CSV files. You must implement get_list, get_count, and load_from_db in the controller, and cache external calls to avoid repeated API requests.