Fix bug where nested task resource-based durations failed to calculate

This commit is contained in:
Dion Moult
2021-09-20 11:52:31 +10:00
parent 20e731235c
commit 5efa65195f
2 changed files with 47 additions and 3 deletions
@@ -47,11 +47,11 @@ class Usecase:
work_day_duration = ifcopenshell.util.date.ifc2datetime(psets["Pset_WorkControlCommon"]["WorkDayDuration"])
return work_day_duration.seconds
def get_work_schedule(self):
for rel in self.settings["task"].HasAssignments or []:
def get_work_schedule(self, task):
for rel in task.HasAssignments or []:
if rel.is_a("IfcRelAssignsToControl") and rel.RelatingControl.is_a("IfcWorkSchedule"):
return rel.RelatingControl
for rel in self.settings["task"].Nests or []:
for rel in task.Nests or []:
return self.get_work_schedule(rel.RelatingObject)
def calculate_duration_in_days(self, resource):