Export Fixtures For DocEvents

Hi Guys,

Is there any way to export fixtures for doc_events …

eg::
doc_events = {
“Sales Order”: {
“on_submit”: “erpnext.selling.doctype.sales_order.custom_hook.sales_order_submission”,
“on_cancel”: “erpnext.selling.doctype.sales_order.custom_hook.sales_order_cacel”,
},
“Purchase Order”: {
“on_submit”: “erpnext.selling.doctype.sales_order.custom_hook.purchase_order_submit”
}
}

@raghu561
kindly brief what do you want to do before asking the solution

Under SalesOrder Doctype, I created custom-file(custom_hook.py).
This file contains customize methods, when I do submit from Sales Order it will enter into custom-file and respective method logic will be executed.
Custom-File methods configurations under this path: frappe-bench/apps/erpnext/erpnext/hooks.py.
Finally I want to create CustomApp for that, I need to export fixtures for doc_events.

I’ve always done this through another app. Create a new app, copy your custom_hook.py file into one of the module folders, then use the hooks.py file in the custom app to call the functions you want. You can then install that app wherever you need.

1 Like

I’m not getting, please can you elaborate explanation…