frappe-impl-controllers

Design and validate Frappe document controllers for custom app DocTypes.

Updated May 31, 2026
One-click install
npx skills add https://github.com/anonymousminati/Res-POS --skill frappe-impl-controllers-anonymousminati
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frappe-impl-controllers
Source: https://github.com/anonymousminati/Res-POS/tree/main/.claude/skills/impl/frappe-impl-controllers
Command: npx skills add https://github.com/anonymousminati/Res-POS --skill frappe-impl-controllers-anonymousminati

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you implement reliable Frappe document controllers without guessing which hook to use, how to structure validation, or how to avoid lifecycle mistakes that break saves, submits, and post-save logic.

Core Features & Use Cases

  • Hook selection: Choose the right lifecycle method for validation, calculations, insert-only actions, submit/cancel workflows, deletions, and change detection.
  • Controller architecture: Build custom DocType controllers, override standard ERPNext controllers safely, and extend child-table or submittable document behavior.
  • Safety and maintainability: Apply flags, avoid common anti-patterns, preserve saved field changes, and keep heavy or external work out of validation paths.
  • Testing and patterns: Follow practical examples for validation, autoname, linked-document updates, and controller tests in real custom app scenarios.

Quick Start

Ask the Skill to design or review a Frappe controller for your DocType and specify the fields, lifecycle events, and validation rules you want implemented.

Frequently Asked Questions about frappe-impl-controllers

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

FAQPage Schema
How do I choose the right Frappe controller hook for validation and calculations?

To override standard ERPNext controllers safely, extend the base class and apply flags-based coordination to preserve saved field changes. This approach maintains lifecycle-safe validation and prevents common anti-patterns that break submit, cancel, or delete workflows in production ERPNext apps.

Can I implement custom naming and linked-document updates in a Frappe DocType controller?

Common Frappe controller anti-patterns include placing heavy or external work inside validation paths, ignoring flags for coordination, and mishandling child table or submittable document lifecycles. Avoiding these mistakes requires keeping validation lightweight and preserving saved field changes during on_update.

How do I test Frappe document controllers for custom app DocTypes?

Testing Frappe document controllers involves writing controller tests that exercise insert, save, submit, cancel, and delete workflows for custom app DocTypes. Practical examples include validating saved calculations, custom naming, and linked-document updates to ensure lifecycle-safe behavior in production scenarios.

What's the best way to handle child table and submittable document behavior in Frappe?

Handling child table and submittable document behavior in Frappe requires extending the appropriate controller class and applying lifecycle hooks like before_submit or on_cancel. Using flags-based coordination ensures parent-child data integrity and prevents validation errors during save and submit workflows.