From f2e73dd687220a1682d4da3d95983cccec7ab68b Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Tue, 7 Aug 2018 16:34:37 +0530 Subject: [PATCH] [fix] Split issue take reference name from communication --- erpnext/support/doctype/issue/issue.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/support/doctype/issue/issue.py b/erpnext/support/doctype/issue/issue.py index 153a4c13c4..0b5eb539c8 100644 --- a/erpnext/support/doctype/issue/issue.py +++ b/erpnext/support/doctype/issue/issue.py @@ -90,11 +90,11 @@ class Issue(Document): # Replicate linked Communications # todo get all communications in timeline before this, and modify them to append them to new doc comm_to_split_from = frappe.get_doc("Communication", communication_id) - communications = frappe.get_all("Communication", filters={"reference_name": 'ISS-00001', "reference_doctype": "Issue", "creation": ('>=', comm_to_split_from.creation)}) + communications = frappe.get_all("Communication", filters={"reference_name": comm_to_split_from.reference_name, "reference_doctype": "Issue", "creation": ('>=', comm_to_split_from.creation)}) for communication in communications: doc = frappe.get_doc("Communication", communication.name) doc.reference_name = replicated_issue.name - doc.save() + doc.save(ignore_permissions=True) return replicated_issue.name def get_list_context(context=None):