# from erpnext.setup.doctype.employee.employee import validate_employee_role as validate_employee_role
# from my_app.overrides.employee import validate_employee_role as custom_validate_employee_role
# validate_employee_role = custom_validate_employee_role
Can you be more specific than “no way worked”? What were you expecting, and what happened?
Note that setting a method path to doc_events.user.validate won’t override the existing validate method. It will just add an additional method called before the document is saved.
from erpnext.setup.doctype.employee.employee import validate_employee_role as validate_employee_role
from my_app.overrides.employee import validate_employee_role as custom_validate_employee_role
validate_employee_role = custom_validate_employee_role
in this way i were expecting override the original validation but no thing happened
in second way it do like what you mention above “add an additional method called before the document is saved.”
and i want to override it
I’m not sure I’m following, but if you’re saying that the method you want to override is called by an event hook defined in hooks.py, I’m afraid I’m not aware of any way to override that.