Getting Issue while calling method throught doc_event



i had created a folder in the material request folder and in there a file material_request.py then add the doc_events in the hooks.py

Hi @Mohtashim_Shoaib:

What is the issue?

Your path to the method is wrong I suppose? There needs to be three “maintenance_addon” in the path, while you have 2. (I’m only referring to the VSCode screenshot you shared, so I might be wrong)

1 Like





@avc @nikkothari22

Try what @nikkothari22 said above. Seems path is not right.



i tried it out but not worked

Hi @Mohtashim_Shoaib:

Try to put your method outside MaterialRequest class.

2 Likes

@Mohtashim_Shoaib check doc_events in this file erpnext/erpnext/hooks.py at develop · frappe/erpnext · GitHub

Hi @Mohtashim_Shoaib,

Please check this documentation, and follow the simple example. No need the define the method in the class but if you want to class base method then use Override DocType Class.

It’s works for me thanks