mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Fix calculating cost item resource value ignoring resource inheritance
Mentioned in #5744
This commit is contained in:
@@ -101,12 +101,11 @@ def calculate_cost_item_resource_value(file: ifcopenshell.file, cost_item: ifcop
|
||||
|
||||
for resource in resources:
|
||||
cost, unit = ifcopenshell.util.resource.get_cost(resource)
|
||||
# TODO: cost is never None because get_cost always returns a float.
|
||||
if cost is None:
|
||||
# Concept to standardise - Not defined in schema, but this makes manual scheduling of resources 10x faster and less duplicate data.
|
||||
parent_cost = ifcopenshell.util.resource.get_parent_cost(resource)
|
||||
assert parent_cost
|
||||
cost, unit = parent_cost
|
||||
if parent_cost:
|
||||
cost, unit = parent_cost
|
||||
quantity = ifcopenshell.util.resource.get_quantity(resource)
|
||||
if cost is None:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user