We know, we can hook to various CRUD events of any doctype.
At that time, Our custom method gets executed after execution of default method.
Is there any way to skip execution of default method.
I want to execute custom validate method in project, instead of standard validate method.
We want to add some custom field on Task, which gets auto filled when we create Task from project.
@max_morais_dmm@kolate_sambhaji This may not work in all use cases. For eg, in our case - we want to allow users to apply for 2 half day leaves on the same day. This becomes necessity, when a user has only 0.5 day balance in Casual Leave. To take a leave, the user applies half a day CL, and then applies Privilege leave for remaining 0.5 days. The default system validation methjod doesnt allow this to happen. We want to write a method that will override the default validation. I can write a hook to do this validation, but it will still execute the default method as well and throw an error. How do I prevent the default method from executing?
Am trying this re_title_tasks on after_insert. However, it does not enter the server side code of re_title_tasks at all.
Tested it with a simple frappe.msgprint and realised hook on after_insert does not work in this situation.
Is there any alternate to renaming tasks after creation?
@max_morais_dmm, Thank you for your help.
Tried the above.
But even for already saved tasks, when it enters re_title_tasks, the for loop is not being done as doc.tasks is empty. Kindly let me know if that works for you. You are able to get a non-empty doc.tasks?