I want to override method which not whitelisted or not class method. I couldn’t get any solution for this till now.
In hooks.py we can override doctype class method and doctype whitelisted method with using override_doctype_class and override_whitelisted_methods. but we cannot override a method which is not any of this.
Option - 1 : Check that in standard code by which function is calling that method which is already in the class.
Once you find the method which is in the class and calling the method you want to override, write the override code on the method which is in class to achieve, what you want to do.
Option - 2 : Copy the full code of standard method which is outside of class and not whitelisted. Use that code in your own method with overrides you want.
This method is daily scheduler_events which is calling from ERPNext hooks.py and placed in Email Campaign Doctype. I want to override it in custom app.
Ok but why you want to override it ? I’m asking you as I haven’t done this but if you have specific task or something where you need to customise, update, add something in that logic I’ll try and let you know.
hello @moe01325
In Email Campaign , there is set_email_campaign_status method which runs daily as it is in schedular events. But this method has error as it is not updating status in database. And because of this issue Email Campaign is not working. So I want to override this method to solve this by saving updated status in database.
Earlier Email Campaign issue is discussed. But there was no solution.
So I have checked core methods and found error in this method which is responsible for this issue.