Rewrite item.py autoname method

I would like to rewrite an item.py autoname method and i have create a custom app and added some code inside and work fine but seems the original autoname will still be run, I don’t want them to be called. How can I completely run my code instead of the original one ?

my custom_app directory structure and right hand side is doc_events in hooks.py
image

I found the answer :
https://discuss.frappe.io/t/how-to-override-method-in-frappe/308/7

before_insert is the magic key

1 Like