Fix bug where editing a schedule finish date by itself wouldn't work

This commit is contained in:
Dion Moult
2021-08-10 10:55:01 +10:00
parent 023dd289fa
commit 1d42ce04eb
3 changed files with 8 additions and 4 deletions
@@ -1,3 +1,7 @@
import ifcopenshell
import ifcopenshell.util.date
class Data: class Data:
is_loaded = False is_loaded = False
resources = {} resources = {}
@@ -14,12 +14,12 @@ class Usecase:
# If the user specifies both an end date and a duration, the duration takes priority # If the user specifies both an end date and a duration, the duration takes priority
if ( if (
"ScheduleWork" in self.settings["attributes"].keys() self.settings["attributes"].get("ScheduleWork", None)
and "ScheduleFinish" in self.settings["attributes"].keys() and "ScheduleFinish" in self.settings["attributes"].keys()
): ):
del self.settings["attributes"]["ScheduleFinish"] del self.settings["attributes"]["ScheduleFinish"]
if ( if (
"ActualWork" in self.settings["attributes"].keys() self.settings["attributes"].get("ActualWork", None)
and "ActualFinish" in self.settings["attributes"].keys() and "ActualFinish" in self.settings["attributes"].keys()
): ):
del self.settings["attributes"]["ActualFinish"] del self.settings["attributes"]["ActualFinish"]
@@ -16,12 +16,12 @@ class Usecase:
# If the user specifies both an end date and a duration, the duration takes priority # If the user specifies both an end date and a duration, the duration takes priority
if ( if (
"ScheduleDuration" in self.settings["attributes"].keys() self.settings["attributes"].get("ScheduleDuration", None)
and "ScheduleFinish" in self.settings["attributes"].keys() and "ScheduleFinish" in self.settings["attributes"].keys()
): ):
del self.settings["attributes"]["ScheduleFinish"] del self.settings["attributes"]["ScheduleFinish"]
if ( if (
"ActualDuration" in self.settings["attributes"].keys() self.settings["attributes"].get("ActualDuration", None)
and "ActualFinish" in self.settings["attributes"].keys() and "ActualFinish" in self.settings["attributes"].keys()
): ):
del self.settings["attributes"]["ActualFinish"] del self.settings["attributes"]["ActualFinish"]