avoid recursion exception

This commit is contained in:
Àngel Àlvarez 2021-12-03 09:42:49 +01:00
parent e6362d468c
commit 1db37e3fd2
1 changed files with 2 additions and 1 deletions

View File

@ -150,7 +150,8 @@ class Plan(ModelSQL, ModelView):
if input_.product.boms:
product_bom = input_.product.boms[0].bom
res.append((input_.product.id, product_bom.id))
res += self.find_boms(product_bom.inputs)
if product_bom.id not in (x[1] for x in res if x):
res += self.find_boms(product_bom.inputs)
return res
@fields.depends('bom', 'boms', 'product')