结果是因为我正在使用
interactive python debugger
ipdb.set_trace();
在递归内部。
我还需要像这样纠正递归
def create_lines(self, item_id=False, parent_id=False):
source_items = self.env['product.source']
duplicate_items = self.env['product.duplicate']
recs = source_items.search([['parent_id', '=', item_id]])
for rec in recs:
value = { 'parent_id': parent_id,
'name': rec.name,
'date': rec.date,
'description': rec.description
}
line = duplicate_items.create(value)
childs = source_items.search([['parent_id', '=', rec_id]])
if (len(childs)):
self.create_lines(self, rec.id, line.id)