ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Rewrite item.py autoname method


#1

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


#2

I found the answer :

before_insert is the magic key


#3