fix: set resolution by only if not on hold (#28995)

This commit is contained in:
Saqib 2021-12-22 19:05:18 +05:30 committed by GitHub
parent 8dc1ce12d4
commit f6d5534627
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -98,6 +98,7 @@ class TestIssue(TestSetUp):
issue.save()
self.assertEqual(issue.on_hold_since, frappe.flags.current_time)
self.assertFalse(issue.resolution_by)
creation = get_datetime("2020-03-04 5:00")
frappe.flags.current_time = get_datetime("2020-03-04 5:00")

View File

@ -476,7 +476,7 @@ def update_response_and_resolution_metrics(doc, apply_sla_for_resolution):
priority = get_response_and_resolution_duration(doc)
start_date_time = get_datetime(doc.get("service_level_agreement_creation") or doc.creation)
set_response_by(doc, start_date_time, priority)
if apply_sla_for_resolution:
if apply_sla_for_resolution and not doc.get('on_hold_since'): # resolution_by is reset if on hold
set_resolution_by(doc, start_date_time, priority)
@ -624,9 +624,6 @@ def reset_resolution_metrics(doc):
if doc.meta.has_field("user_resolution_time"):
doc.user_resolution_time = None
if doc.meta.has_field("agreement_status"):
doc.agreement_status = "First Response Due"
# called via hooks on communication update
def on_communication_update(doc, status):