mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-27 22:05:19 +00:00
fix: moved erpnext related methods from frappe to erpnext
This commit is contained in:
@@ -13,6 +13,7 @@ from frappe.model.mapper import get_mapped_doc
|
||||
from frappe.utils.user import is_website_user
|
||||
from ..service_level_agreement.service_level_agreement import get_active_service_level_agreement_for
|
||||
from erpnext.crm.doctype.opportunity.opportunity import assign_to_user
|
||||
from frappe.email.inbox import link_communication_to_document
|
||||
|
||||
sender_field = "raised_by"
|
||||
|
||||
@@ -294,3 +295,19 @@ def make_task(source_name, target_doc=None):
|
||||
"doctype": "Task"
|
||||
}
|
||||
}, target_doc)
|
||||
@frappe.whitelist()
|
||||
def make_issue_from_communication(communication, ignore_communication_links=False):
|
||||
""" raise a issue from email """
|
||||
|
||||
doc = frappe.get_doc("Communication", communication)
|
||||
issue = frappe.get_doc({
|
||||
"doctype": "Issue",
|
||||
"subject": doc.subject,
|
||||
"communication_medium": doc.communication_medium,
|
||||
"raised_by": doc.sender or "",
|
||||
"raised_by_phone": doc.phone_no or ""
|
||||
}).insert(ignore_permissions=True)
|
||||
|
||||
link_communication_to_document(doc, "Issue", issue.name, ignore_communication_links)
|
||||
|
||||
return issue.name
|
||||
|
||||
Reference in New Issue
Block a user