Merge pull request #24496 from frappe/template-task-parent-child-deadlock

fix: Template task parent child deadlock