Fix #2206. Bug where removing a cost item with active data created an error.

This commit is contained in:
Dion Moult
2023-01-31 14:33:29 +11:00
parent f9cfd17303
commit 95e924a5bc
2 changed files with 3 additions and 1 deletions
@@ -239,6 +239,8 @@ class RemoveCostItem(bpy.types.Operator, tool.Ifc.Operator):
contracted_cost_items.remove(props.active_cost_item_index)
props.contracted_cost_items = json.dumps(contracted_cost_items)
bpy.ops.bim.enable_editing_cost_items(cost_schedule=props.active_cost_schedule_id)
if props.active_cost_item_id == self.cost_item:
props.active_cost_item_id = 0
return {"FINISHED"}
+1 -1
View File
@@ -64,7 +64,7 @@ def assign_work_schedule(ifc, sequence, work_plan=None, work_schedule=None):
def unassign_work_schedule(ifc, work_plan=None, work_schedule=None):
ifc.run("aggregate.unassign_object", relating_object=work_plan, product=work_schedule)
ifc.run("aggregate.unassign_object", product=work_schedule)
def enable_editing_work_schedule(sequence, work_schedule=None):