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:
#in hooks.py
doc_events = {
"Payment Entry": {"validate":"{path.to.custom.app}.utils.custom_payment_entry_validation"}
}
then…
#in utils.py
def custom_payment_entry_validation(doc,method):
print("Called")
doc.validate = validate
doc.validate(doc)
def validate(self):
print("Overridden")
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?