Override frappe framework method

Hi,

I have been overriding methods inside core ERPnext using hooks declaration. Could someone guide me to the process to override a method inside the frappe framework?

Hello @Basant You override methods in the Frappe framework in exactly the same way as you do in ERPNext,

In your Custom app.

Options for overriding a Python function:

  1. If it is a whitelisted method, use the override_whitelisted_methods hook.

  2. If it is a standard doctype classes , use override_doctype_class hook.

  3. For document methods and events, use doc_events hook.

  4. If it falls outside these options, you can use monkey patching. Frappe Monkey Patching Guide: Overriding/Change Core Code Without Touching it

Overriding JavaScript classes - Use files under public/js

2 Likes