ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Change to how works?


I have a custom app that uses doc_events to override the validation method of a particular doctype (Payment Entry). On the develop branch, until recently, it worked fine, but suddenly it’s not working. My override method gets called, but so does the original.

My code looks like this:

doc_events = {
	"Payment Entry": {"validate":"{}.utils.custom_payment_entry_validation"}


def custom_payment_entry_validation(doc,method):
	doc.validate = validate
def validate(self):

Both “Called” and “Overridden” show up in the console as I’d hoped, but the original validate method gets called as well on top of everything else.

Any suggestions?


This is by design from the starting, it never override the existing method, doc_events extend the existing method.



Please refer the below link. May be use full to you.