fix(Issue): track split from in issue (#18994)

* fix: track split from in issue

* fix: rename field name

* fix: remove first_mins to response
This commit is contained in:
Himanshu 2019-09-11 19:20:20 +05:30 committed by Nabin Hait
parent cd38ba4833
commit e3ef56804c
3 changed files with 403 additions and 384 deletions

View File

@ -107,7 +107,7 @@ frappe.ui.form.on("Issue", {
}, () => {
reset_sla.enable_primary_action();
frm.refresh();
frappe.msgprint(__("Service Level Agreement Reset."));
frappe.msgprint(__("Service Level Agreement was reset."));
});
}
});

View File

@ -16,6 +16,7 @@
"status",
"priority",
"issue_type",
"issue_split_from",
"sb_details",
"description",
"service_level_section",
@ -351,12 +352,19 @@
"fieldname": "reset_service_level_agreement",
"fieldtype": "Button",
"label": "Reset Service Level Agreement"
},
{
"fieldname": "issue_split_from",
"fieldtype": "Link",
"label": "Issue Split From",
"options": "Issue",
"read_only": 1
}
],
"icon": "fa fa-ticket",
"idx": 7,
"modified": "2019-07-11 23:57:22.015881",
"modified_by": "Administrator",
"modified": "2019-09-11 09:03:57.465623",
"modified_by": "himanshu@erpnext.com",
"module": "Support",
"name": "Issue",
"owner": "Administrator",
@ -381,4 +389,4 @@
"title_field": "subject",
"track_changes": 1,
"track_seen": 1
}
}

View File

@ -117,6 +117,9 @@ class Issue(Document):
replicated_issue = deepcopy(self)
replicated_issue.subject = subject
replicated_issue.issue_split_from = self.name
replicated_issue.mins_to_first_response = 0
replicated_issue.first_responded_on = None
replicated_issue.creation = now_datetime()
# Reset SLA
@ -144,6 +147,14 @@ class Issue(Document):
doc.reference_name = replicated_issue.name
doc.save(ignore_permissions=True)
frappe.get_doc({
"doctype": "Comment",
"comment_type": "Info",
"reference_doctype": "Issue",
"reference_name": replicated_issue.name,
"content": " - Split the Issue from <a href='#Form/Issue/{0}'>{1}</a>".format(self.name, frappe.bold(self.name)),
}).insert(ignore_permissions=True)
return replicated_issue.name
def before_insert(self):