Skip to Content
Menu
This question has been flagged
2 Replies
2823 Views

Hello i have a question about checking records if the have children records

Avatar
Discard

elaborate your query

Best Answer

Hi,

This how you can do:

child_ids = self.search([('parent_id','=',self.id)])
if child_ids:
     return True
else:
     return False
Avatar
Discard