def recursion(products, parent_name):
for product in products:
name = product['name']
yield f'Текущий - {name}', f'Родитель - {parent_name}'
sub_products = product.get('products', [])
if sub_products:
yield from recursion(sub_products, name)
for x,y in recursion(products, 'root'):
print(x,y)