@api.multi
def unlink(self):
parent= self.search([('parent_id', 'in', self.ids)])
for child in parent:
child.unlink()
return super(ProjectTask, self).unlink()
@api.multi
is considered to be used when you need to do something with model itself and don't need to modify/check some exact model's record/records. For example there could be method that returns some meta info about model's structure or some helper methods, etc