mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-05 22:48:27 +00:00
fix: reset issue metrics on Reopen and Split
This commit is contained in:
@@ -71,6 +71,7 @@ class Issue(Document):
|
|||||||
if self.status=="Open" and status !="Open":
|
if self.status=="Open" and status !="Open":
|
||||||
# if no date, it should be set as None and not a blank string "", as per mysql strict config
|
# if no date, it should be set as None and not a blank string "", as per mysql strict config
|
||||||
self.resolution_date = None
|
self.resolution_date = None
|
||||||
|
self.reset_issue_metrics()
|
||||||
|
|
||||||
def update_agreement_status(self):
|
def update_agreement_status(self):
|
||||||
if self.service_level_agreement and self.agreement_fulfilled == "Ongoing":
|
if self.service_level_agreement and self.agreement_fulfilled == "Ongoing":
|
||||||
@@ -131,6 +132,7 @@ class Issue(Document):
|
|||||||
replicated_issue.response_by_variance = None
|
replicated_issue.response_by_variance = None
|
||||||
replicated_issue.resolution_by = None
|
replicated_issue.resolution_by = None
|
||||||
replicated_issue.resolution_by_variance = None
|
replicated_issue.resolution_by_variance = None
|
||||||
|
replicated_issue.reset_issue_metrics()
|
||||||
|
|
||||||
frappe.get_doc(replicated_issue).insert()
|
frappe.get_doc(replicated_issue).insert()
|
||||||
|
|
||||||
@@ -224,6 +226,12 @@ class Issue(Document):
|
|||||||
self.agreement_fulfilled = "Ongoing"
|
self.agreement_fulfilled = "Ongoing"
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
|
def reset_issue_metrics(self):
|
||||||
|
self.db_set('resolution_time', 0)
|
||||||
|
self.db_set('user_operational_time', 0)
|
||||||
|
self.db_set('avg_response_time',0)
|
||||||
|
|
||||||
|
|
||||||
def get_expected_time_for(parameter, service_level, start_date_time):
|
def get_expected_time_for(parameter, service_level, start_date_time):
|
||||||
current_date_time = start_date_time
|
current_date_time = start_date_time
|
||||||
expected_time = current_date_time
|
expected_time = current_date_time
|
||||||
|
|||||||
Reference in New Issue
Block a user