fix(Issue): track issue split from (#18995)
* fix: track issue split from * fix: comment on issue split * Update issue.py
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -87,6 +87,7 @@ class Issue(Document):
|
||||
from copy import deepcopy
|
||||
replicated_issue = deepcopy(self)
|
||||
replicated_issue.subject = subject
|
||||
replicated_issue.issue_split_from = self.name
|
||||
frappe.get_doc(replicated_issue).insert()
|
||||
# Replicate linked Communications
|
||||
# todo get all communications in timeline before this, and modify them to append them to new doc
|
||||
@@ -96,6 +97,15 @@ class Issue(Document):
|
||||
doc = frappe.get_doc("Communication", communication.name)
|
||||
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 get_list_context(context=None):
|
||||
@@ -177,4 +187,4 @@ def make_issue_from_communication(communication, ignore_communication_links=Fals
|
||||
|
||||
link_communication_to_document(doc, "Issue", issue.name, ignore_communication_links)
|
||||
|
||||
return issue.name
|
||||
return issue.name
|
||||
|
||||
Reference in New Issue
Block a user