Hooks add or overwrite method?

I have a problem that I have seen that you already have that is in the hooks.py of the created app, I would like to know if it has how to give overwrite in the events of an erpnext doctype, I tried to use the hooks.py but it does not overwrite it just add .
Thanks in advance.

A specific case of what you have tried here, would illustrate what it is you wish to do…

Please can you little more specific what you want to achieve, add screenshots as well.

I’m sorry, I’ll send pictures

This is my hooks

This is my method

And this the production order method

Thanks for help.

No problem thanks Thiago. I appreciate your problem case to learn how doc_events works.

I wonder Is this path correct, that may explain the problem “{path.test.test.validate_qty}”

I am grepping the code for examples with this

frappe@erpnext:~/frappe-bench$ find . -name *.py | xargs grep “doc_events”


Hi @clarkej, I’m horrible with explanations I suppose that I’m not explain right but I get it.
I managed to resolve however I had to change the document file in frappe that is in frappe.frappe.model.document located at line 860 I just added an if, as in hooks.py even putting a method there erpnext continues to perform its functions and validations by changing This file managed to make it execute only my function and I did not have to change the erpnext.
Thanks for for help.

Could this be why your validate doesn’t work?

go to user menu and click on “Reload”. It will clear frappe’s cache where hooks are cached.

You can also do that from the command line using:
bench --site SITENAME clear-cache

Those tips I found here How to know hooks binding to a specific doctype? - #4 by max_morais_dmm

Thanks for the learning @Thiago_Henry :slight_smile:


Thank you @clarkej.