Skip to content

Commit bf11f5b

Browse files
shariquerikmergify[bot]
authored andcommitted
fix: reverted rolling sla status logic based on past failure
(cherry picked from commit dbf97a5)
1 parent 396b0c3 commit bf11f5b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,15 @@ def handle_rolling_sla_status(self, doc: Document):
187187
if not self.rolling_responses or len(doc.rolling_responses) == 0:
188188
return
189189

190-
# Check both the current cycle and past rolling response entries
191-
has_past_failure = any(r.status == "Failed" for r in doc.rolling_responses)
192-
193-
if has_past_failure or self.is_rolling_response_failed(doc):
194-
doc.sla_status = "Failed"
195-
elif doc.communication_status == self.get_default_priority():
196-
doc.sla_status = "Rolling Response Due"
197-
else:
198-
doc.sla_status = "Fulfilled"
190+
is_failed = self.is_rolling_response_failed(doc)
191+
options = {
192+
"Fulfilled": True,
193+
"Rolling Response Due": doc.communication_status == self.get_default_priority(),
194+
"Failed": is_failed,
195+
}
196+
for status in options:
197+
if options[status]:
198+
doc.sla_status = status
199199

200200
def is_rolling_response_failed(self, doc: Document):
201201
if not doc.response_by:

0 commit comments

Comments
 (0)