doctype-patterns
БесплатноБез исполняемых скриптовНе проверенFrappe DocType creation patterns, field types, controller hooks, and data modeling best practices. Use when creating DocTypes, designing data models, adding…
Об этом скилле
Frappe DocType Patterns
Comprehensive guide to creating and configuring DocTypes in Frappe Framework, the core building block for all Frappe applications.
When to Use This Skill
- Creating new DocTypes
- Adding or modifying fields on DocTypes
- Designing data models and relationships
- Setting up naming patterns and autoname
- Configuring permissions and workflows
- Creating child tables
- Working with Virtual or Single DocTypes
DocType Directory Structure
When you create a DocType named "My Custom DocType" in module "My Module":
my_app/
└── my_module/
└── doctype/
└── my_custom_doctype/
├── my_custom_doctype.json # DocType definition
├── my_custom_doctype.py # Python controller
├── my_custom_doctype.js # Client script
├── test_my_custom_doctype.py # Test file
└── __init__.py
DocType JSON Structure
{
"name": "My Custom DocType",
"module": "My Module",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": ["field1", "field2"],
"fields": [
{
"fieldname": "field1",
"fieldtype": "Data",
"label": "Field 1",
"reqd": 1
}
],
"permissions": [
{
"role": "System Manager",
"read": 1,
"write": 1,
"create": 1,
"delete": 1
}
],
"autoname": "naming_series:",
"naming_rule": "By \"Naming Series\" field",
"is_submittable": 0,
"istable": 0,
"issingle": 0,
"track_changes": 1,
"sort_field": "modified",
"sort_order": "DESC"
}
Field Types Reference
Text Fields
| Type | Description | Use Case |
|---|---|---|
Data |
Single line text (140 chars) | Names, codes, short text |
Small Text |
Multi-line text | Short descriptions |
Text |
Multi-line text (unlimited) | Long descriptions |
Text Editor |
Rich text with formatting | Content, notes |
Code |
Syntax-highlighted code | Python, JS, JSON |
HTML Editor |
WYSIWYG HTML | Email templates |
Markdown Editor |
Markdown input | Documentation |
Password |
Masked input | Secrets (stored encrypted) |
Numeric Fields
| Type | Description | Use Case |
|---|---|---|
Int |
Integer | Counts, quantities |
Float |
Decimal number | Measurements |
Currency |
Money with precision | Prices, amounts |
Percent |
0-100 percentage | Discounts, rates |
Rating |
Star rating (0-1) | Reviews, scores |
Date/Time Fields
| Type | Description | Use Case |
|---|---|---|
Date |
Date only | Birth dates, due dates |
Datetime |
Date and time | Timestamps |
Time |
Time only | Schedules |
Duration |
Time duration | Task duration |
Selection Fields
| Type | Description | Use Case |
|---|---|---|
Select |
Dropdown options | Status, type |
Check |
Boolean checkbox | Flags, toggles |
Autocomplete |
Text with suggestions | Tags |
Link Fields
| Type | Description | Use Case |
|---|---|---|
Link |
Reference to another DocType | Foreign key relationship |
Dynamic Link |
Reference based on another field | Polymorphic links |
Table |
Child table (1-to-many) | Line items, details |
Table MultiSelect |
Many-to-many via link | Multiple selections |
Special Fields
| Type | Description | Use Case |
|---|---|---|
Attach |
Single file attachment | Documents |
Attach Image |
Image with preview | Photos, logos |
Image |
Display image from URL field | Gallery |
Signature |
Signature pad | Approvals |
Geolocation |
Map coordinates | Locations |
Barcode |
Barcode/QR display | Inventory |
JSON |
JSON data | Configuration |
Layout Fields
| Type | Description | Use Case |
|---|---|---|
Section Break |
Horizontal section divider | Form organization |
Column Break |
Vertical column divider | Multi-column layout |
Tab Break |
Tab navigation | Large forms |
HTML |
Static HTML content | Instructions, headers |
Heading |
Section heading | Visual separation |
Button |
Clickable button | Actions |
Field Options
Common Field Properties
{
"fieldname": "customer",
"fieldtype": "Link",
"label": "Customer",
"options": "Customer",
"reqd": 1,
"unique": 0,
"in_list_view": 1,
"in_standard_filter": 1,
"in_global_search": 1,
"bold": 1,
"read_only": 0,
"hidden": 0,
"print_hide": 0,
"no_copy": 0,
"allow_in_quick_entry": 1,
"translatable": 0,
"default": "",
"description": "Select the customer",
"depends_on": "eval:doc.is_customer",
"mandatory_depends_on": "eval:doc.status=='Active'",
"read_only_depends_on": "eval:doc.docstatus==1"
}
Link Field Options
{
"fieldname": "customer",
"fieldtype": "Link",
"options": "Customer",
"filters": {
"disabled": 0,
"customer_type": "Company"
},
"ignore_user_permissions": 0
}
Sele
Установить doctype-patterns в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл doctype-patterns?
Frappe DocType creation patterns, field types, controller hooks, and data modeling best practices. Use when creating DocTypes, designing data models, adding fields, or setting up document relationships in Frappe/ERPNext.
Как установить скилл doctype-patterns?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл doctype-patterns запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic