See #7716. Remove_cost_item also delete the assignment

Previously remove_cost_item leaved orphaned relation now it should be fixed
This commit is contained in:
Massimo Fabbro
2026-03-07 22:10:53 +01:00
committed by Massimo Fabbro
parent 5febbc1391
commit e392d2da6e
@@ -51,7 +51,7 @@ def remove_cost_item(file: ifcopenshell.file, cost_item: ifcopenshell.entity_ins
if history:
ifcopenshell.util.element.remove_deep2(file, history)
elif inverse.is_a("IfcRelAssignsToControl"):
if len(inverse.RelatedObjects) >= 2 or inverse.RelatingControl == cost_item:
if len(inverse.RelatedObjects) >= 2:
continue
history = inverse.OwnerHistory
file.remove(inverse)