Use only components without product from the template as the default components for the product

Closes #14246
This commit is contained in:
Cédric Krier
2025-09-19 14:04:29 +02:00
parent b934cd7b4e
commit 63ef97ca4f
+6 -1
View File
@@ -82,7 +82,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):