frappe-impl-controllers

Implement Frappe Document Controllers with validation, lifecycle hooks, and overrides.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/nathanabay/epc_bespo --skill frappe-impl-controllers-nathanabay
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frappe-impl-controllers
Source: https://github.com/nathanabay/epc_bespo/tree/main/skills-frappe/impl/frappe-impl-controllers
Command: npx skills add https://github.com/nathanabay/epc_bespo --skill frappe-impl-controllers-nathanabay

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies the process of building server-side document controllers in custom Frappe applications, enabling developers to manage document lifecycle hooks, validation, autonaming, and workflows efficiently.

Core Features & Use Cases

  • Controller Implementation: Guides in creating and overriding doctype controllers for custom logic.
  • Lifecycle Management: Provides step-by-step workflows for validation, submission, cancellation, and deletion handling.
  • Use Case: A developer sets up a comprehensive Document Controller for a sales order, including validation, custom naming, and post-submit actions, following recommended pattern and hook order.

Quick Start

Use the frappe-impl-controllers skill to create a new Document Controller that validates date fields and calculates totals before saving.

Frequently Asked Questions about frappe-impl-controllers

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

FAQPage Schema
How do I create a custom document controller in Frappe?

To create a custom document controller in Frappe, you implement server-side Python classes that override doctype controllers. This approach manages document lifecycle hooks, validation logic, and custom autonaming to ensure reliable data integrity.

What is the best way to manage document lifecycle hooks in Frappe?

Managing document lifecycle hooks in Frappe involves overriding specific doctype controller methods for validation, submission, cancellation, and deletion. This ensures reliable document workflows by executing custom logic at precise stages of the document state transition.

How do I add validation logic before saving a document in Frappe?

To add validation logic before saving a document in Frappe, you implement the validate method inside your custom doctype controller. This allows you to check field constraints, calculate totals, and enforce data integrity before the document is committed to the database.

How do I handle post-submit actions in a Frappe doctype controller?

Handling post-submit actions in a Frappe doctype controller requires overriding the on_submit method. This allows you to trigger custom server-side workflows, update related documents, or execute specific business logic immediately after the document state changes to submitted.

Can I use this approach to set up custom autonaming for Frappe doctypes?

Yes, you can set up custom autonaming for Frappe doctypes by overriding the autoname method within your document controller. This allows you to generate dynamic naming patterns based on document fields and specific business logic before the document is saved.

What is the recommended pattern for override methods in Frappe controllers?

The recommended pattern for override methods in Frappe controllers involves extending the base doctype class and calling the parent method using super(). This maintains core framework behavior while injecting custom validation, lifecycle management, and client-server interaction logic.