frappe-impl-controllers

Automate Frappe/ERPNext Document Controller design with validation and lifecycle hooks.

163|53|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/OpenAEC-Foundation/Frappe_Claude_Skill_Package --skill frappe-impl-controllers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frappe-impl-controllers
Source: https://github.com/OpenAEC-Foundation/Frappe_Claude_Skill_Package/tree/main/skills/source/impl/frappe-impl-controllers
Command: npx skills add https://github.com/OpenAEC-Foundation/Frappe_Claude_Skill_Package --skill frappe-impl-controllers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building robust Document Controllers in a custom Frappe/ERPNext app can be complex due to multiple lifecycle hooks, validation patterns, and safe override strategies. This Skill provides structured workflows and best practices to implement controllers that coordinate validation, saving, submitting, and cross-document interactions in a maintainable way.

Core Features & Use Cases

  • Document Controller scaffolding: define a controller class, connect it to the doctype lifecycle, and implement common hooks like validate, before_submit, on_submit, and on_update.
  • Safe overrides and testing: guidelines for super() usage, extension patterns (override_doctype_class, hooks), and testing strategies with unit tests.
  • Practical examples: step-by-step patterns including decision trees, validation workflows, and post-submit actions with real-world ERPNext scenarios.

Quick Start

Write a minimal Document Controller for a custom DocType by creating a Python class that extends Document, implements validate(), and triggers a simple on_submit workflow.

Frequently Asked Questions about frappe-impl-controllers

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

FAQPage Schema
How do I implement document controllers in Frappe with validation and lifecycle hooks?

Document controllers in Frappe are implemented by creating a Python class extending Document, then defining validate(), before_submit, and on_update hooks to manage server-side DocType logic and cross-document interactions safely.

What is the best way to override standard ERPNext DocType controllers safely?

The best way to override ERPNext controllers is using the override_doctype_class hook, ensuring safe super() usage to maintain extension points and prevent breaking core framework updates or existing validation workflows.

How do I test custom Frappe document controllers and validation workflows?

Testing custom Frappe document controllers requires implementing unit tests that validate lifecycle hooks, naming patterns, and submit workflows, ensuring safe super() usage and maintainable extension points across v14–v16.

Can I use hooks to extend Frappe document controllers without modifying core code?

Yes, you can use Frappe hooks like override_doctype_class to extend document controllers, applying validation logic and lifecycle overrides without altering core ERPNext code, ensuring safe super() usage and maintainable extension points.

Why does my Frappe document controller validation fail on submit?

Frappe document controller validation often fails on submit due to incorrect hook ordering or missing super() calls in before_submit or on_submit methods, disrupting safe override strategies and post-submit actions.

Do I need the frappe-impl-controllers pattern for building custom ERPNext apps?

Building custom ERPNext apps requires structured document controller patterns to coordinate validation, lifecycle hooks, and cross-document interactions safely, ensuring maintainable extension points across framework versions.