跳至內容
選單
此問題已被標幟
2 回覆
3261 瀏覽次數

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

頭像
捨棄

elaborate your query

最佳答案

Hi,

This how you can do:

child_ids = self.search([('parent_id','=',self.id)])
if child_ids:
     return True
else:
     return False
頭像
捨棄