From 628613a2b332a31b178b4c9cae55cca602592fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=80ngel=20=C3=80lvarez=20Serra?= Date: Tue, 14 Dec 2021 17:04:09 +0100 Subject: [PATCH] avoid recursion exception (#1) #044450 avoid recursion exception --- plan.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plan.py b/plan.py index 16033a4..fdaf5ac 100644 --- a/plan.py +++ b/plan.py @@ -145,7 +145,8 @@ class Plan(DeactivableMixin, 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): + res += self.find_boms(product_bom.inputs) return res @fields.depends('bom', 'boms', 'product')