Frappe Doctype Controller

Expert guidance for implementing Frappe DocType Python controllers. Covers the complete hook execution order for insert, save, submit, cancel, delete, load, and rename operations; context guards (is_new(), docstatus, flags, _action); hook placement rules (before_validate vs before_insert vs before_save); detecting field changes with get_doc_before_save(); Document API (insert/save/submit/cancel/delete/rename params); bypassing hooks with db_set vs frappe.db.set_value; and error-raising conventions. Use when writing or debugging .py controller files, choosing which hook to implement, or fixing bugs caused by logic placed in the wrong hook.

kehwar ab9fef1 2 files · 20.3 KB Updated

File contents

kehwar/skills/tree/main/skills/frappe/frappe-doctype-controller commit ab9fef187f

Frequently asked questions

npx skillmds@latest add kehwar/frappe-doctype-controller