erpnext-frappe-dev について
erpnext-frappe-devは、Frappe FrameworkまたはERPNextのアプリ開発者向けClaude Codeリファレンススキルです。アプリ構成、カスタマイズ、データ操作、RESTエンドポイントなどのAPI資料をまとめています。
主な機能
- 01Document・Database APIリファレンス
- 02コントローラーとhooksのガイド
- 03REST APIエンドポイント資料
- 04クライアント側フォームスクリプト例
- 05会計・在庫・人事の資料
活用シーン
- 01FrappeまたはERPNextのカスタムアプリ作成
- 02DocTypeとコントローラーロジックの実装
- 03hooksによるイベントのカスタマイズ
- 04REST APIやフォームスクリプトの作成
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ 6missedcalls/ erpnext-skill --skill erpnext-frappe-devインストール後、Claude Code で/erpnext-frappe-devを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
.gitignoreLICENSEREADME.md.github/PULL_REQUEST_TEMPLATE.mdreference/database-api.mdindex.mdhooks-reference.mddocument-api.mdform-scripts.mdfrappe-framework-complete.mdrest-api.mdreference/accounting/overview.mdreference/api/rest-api.mddeveloper-api.mdreference/assets/overview.mdreference/buying/overview.mdreference/crm/overview.mdreference/customization/overview.mdreference/hr-payroll/overview.mdreference/integrations/overview.mdreference/manufacturing/overview.mdreference/pos/overview.mdreference/projects/overview.mdreference/selling/overview.mdreference/setup/overview.mdreference/stock/overview.mdreference/support/overview.md詳細
Frappe Framework 開発リファレンス
Frappe Framework / ERPNext でアプリケーションを構築するための完全なドキュメントです。このスキルには、Claude Code が Frappe アプリをゼロから構築するために必要な包括的な API ドキュメントが含まれています。
このスキルを使用するタイミング
次の場合にこのスキルを使用してください。
- 新しい Frappe/ERPNext カスタムアプリを作成する
- DocType とコントローラーを構築する
- カスタマイズ用のフックを記述する
- REST API を実装する
- フォームスクリプト(クライアント側 JS)を作成する
- バックグラウンドジョブを記述する
- 外部サービスとの連携を構築する
- その他、ERPNext/Frappe の開発作業を行う
クイックスタート
アプリを作成する
bench new-app my_app
bench --site mysite install-app my_app
主なファイル
hooks.py— アプリレベルの設定とイベントハンドラー{doctype}.py— Python コントローラー(サーバー側のロジック){doctype}.js— フォームスクリプト(クライアント側のロジック){doctype}.json— DocType の定義
ドキュメント一覧
| リファレンス | 内容 |
|---|---|
reference/frappe-framework-complete.md | メインリファレンス — Document、Database、Controllers、Hooks、REST API、Form Scripts、Testing の完全な API ドキュメント |
reference/document-api.md | Document の CRUD 操作 |
reference/database-api.md | データベースクエリとトランザクション |
reference/hooks-reference.md | hooks.py の設定 |
reference/rest-api.md | REST API エンドポイント |
reference/form-scripts.md | クライアント側 JavaScript |
reference/index.md | ERPNext モジュールのドキュメント一覧 |
reference/accounting/ | 会計モジュールのリファレンス |
reference/stock/ | 在庫/Stock モジュールのリファレンス |
reference/manufacturing/ | 製造モジュールのリファレンス |
reference/crm/ | CRM モジュールのリファレンス |
reference/hr-payroll/ | 人事・給与モジュールのリファレンス |
reference/api/ | REST と開発者向け API のリファレンス |
コアコンセプトの概要
DocType = モデル
# DocType "Customer" creates:
# - Database table `tabCustomer`
# - Python controller customer.py
# - Form script customer.js
Document = インスタンス
doc = frappe.get_doc("Customer", "CUST-001")
doc.customer_name = "Updated Name"
doc.save()
Controller = ビジネスロジック
class Customer(Document):
def validate(self):
if not self.email:
frappe.throw("Email required")
def on_submit(self):
self.create_linked_records()
Hooks = アプリ設定
# hooks.py
doc_events = {
"Sales Order": {
"on_submit": "my_app.events.on_sales_order_submit"
}
}
API クイックリファレンス
Document 操作
frappe.get_doc(doctype, name) # Get document
frappe.new_doc(doctype) # Create new
doc.insert() # Insert to DB
doc.save() # Update in DB
doc.delete() # Delete
doc.db_set(field, value) # Direct DB update
データベースクエリ
frappe.db.get_list(doctype, filters, fields) # With permissions
frappe.db.get_all(doctype, filters, fields) # All records
frappe.db.get_value(doctype, name, field) # Single value
frappe.db.set_value(doctype, name, field, val) # Direct update
frappe.db.exists(doctype, name) # Check exists
frappe.db.count(doctype, filters) # Count records
コントローラーフック
autoname → before_insert → validate → before_save →
on_update → after_insert → on_submit → on_cancel
REST API
GET /api/resource/{doctype} # List
GET /api/resource/{doctype}/{name} # Read
POST /api/resource/{doctype} # Create
PUT /api/resource/{doctype}/{name} # Update
DELETE /api/resource/{doctype}/{name} # Delete
POST /api/method/{dotted.path} # Custom method
フォームスクリプト
frappe.ui.form.on('DocType', {
refresh(frm) { },
validate(frm) { },
fieldname(frm) { } // Field change
});
ドキュメント全文を読む
まずはこちら: reference/frappe-framework-complete.md
このファイルには、すべての Frappe API を網羅した 20KB 以上の包括的なドキュメントが、コード例とともに記載されています。
コメント
Markdown 対応