From 04145de8144ff65a18b40de9e8d1b5802da12953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 19 Sep 2025 14:04:29 +0200 Subject: [PATCH] Use only components without product from the template as the default components for the product Closes #14246 (grafted from a18da648907c39895f364502b1e361a51439f462) --HG-- branch : 6.0 --- modules/product_kit/product.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/product_kit/product.py b/modules/product_kit/product.py index 291baa197a..21f7e0bf90 100644 --- a/modules/product_kit/product.py +++ b/modules/product_kit/product.py @@ -77,7 +77,12 @@ class Product(metaclass=PoolMeta): @property def components_used(self): - return self.components or self.template.components + if self.components: + yield from self.components + else: + for component in self.template.components: + if not component.parent_product: + yield component @classmethod def get_quantity(cls, products, name):