[rename] Support Ticket -> Issue
This commit is contained in:
parent
1caa1a3708
commit
bd9b62ff28
@ -8,7 +8,7 @@ def get_data():
|
||||
"items": [
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "Support Ticket",
|
||||
"name": "Issue",
|
||||
"description": _("Support queries from customers."),
|
||||
},
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ website_generators = ["Item Group", "Item", "Sales Partner"]
|
||||
|
||||
standard_queries = "Customer:erpnext.selling.doctype.customer.customer.get_customer_list"
|
||||
|
||||
communication_covert_to = ["Lead", "Support Ticket", "Job Application"]
|
||||
communication_covert_to = ["Lead", "Issue", "Job Application"]
|
||||
|
||||
doc_events = {
|
||||
"Stock Entry": {
|
||||
|
@ -52,8 +52,8 @@ erpnext.patches.v4_0.fix_address_template
|
||||
erpnext.patches.v4_0.reset_permissions_for_masters
|
||||
|
||||
erpnext.patches.v4_0.update_tax_amount_after_discount
|
||||
execute:frappe.reset_perms("GL Entry") #2014-06-09
|
||||
execute:frappe.reset_perms("Stock Ledger Entry") #2014-06-09
|
||||
execute:frappe.permissions.reset_perms("GL Entry") #2014-06-09
|
||||
execute:frappe.permissions.reset_perms("Stock Ledger Entry") #2014-06-09
|
||||
erpnext.patches.v4_0.create_custom_fields_for_india_specific_fields
|
||||
erpnext.patches.v4_0.save_default_letterhead
|
||||
erpnext.patches.v4_0.update_custom_print_formats_for_renamed_fields
|
||||
@ -95,3 +95,4 @@ erpnext.patches.v5_0.update_dn_against_doc_fields
|
||||
execute:frappe.db.sql("update `tabMaterial Request` set material_request_type = 'Material Transfer' where material_request_type = 'Transfer'")
|
||||
execute:frappe.reload_doc('stock', 'doctype', 'item')
|
||||
execute:frappe.db.sql("update `tabItem` i set apply_warehouse_wise_reorder_level=1, re_order_level=0, re_order_qty=0 where exists(select name from `tabItem Reorder` where parent=i.name)")
|
||||
execute:frappe.rename_doc("DocType", "Support Ticket", "Issue", force=True)
|
||||
|
@ -32,7 +32,7 @@ doctype_series_map = {
|
||||
'Stock Entry': 'STE-',
|
||||
'Supplier': 'SUPP-',
|
||||
'Supplier Quotation': 'SQTN-',
|
||||
'Support Ticket': 'SUP-'
|
||||
'Issue': 'SUP-'
|
||||
}
|
||||
|
||||
def check_docs_to_rename():
|
||||
|
@ -2,7 +2,7 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.permissions import reset_perms
|
||||
|
||||
def execute():
|
||||
for doctype in ("About Us Settings", "Accounts Settings", "Activity Type",
|
||||
@ -14,7 +14,7 @@ def execute():
|
||||
"Mode of Payment", "Module Def", "Naming Series", "POS Setting", "Print Heading",
|
||||
"Report", "Role", "Selling Settings", "Stock Settings", "Supplier Type", "UOM"):
|
||||
try:
|
||||
frappe.reset_perms(doctype)
|
||||
reset_perms(doctype)
|
||||
except:
|
||||
print "Error resetting perms for", doctype
|
||||
raise
|
||||
|
@ -29,7 +29,7 @@ doctype_series_map = {
|
||||
'Stock Entry': 'STE-',
|
||||
'Supplier': 'SUPP-',
|
||||
'Supplier Quotation': 'SQTN-',
|
||||
'Support Ticket': 'SUP-'
|
||||
'Issue': 'SUP-'
|
||||
}
|
||||
|
||||
def execute():
|
||||
|
@ -61,7 +61,7 @@ class Lead(SellingController):
|
||||
frappe.throw(_("Email id must be unique, already exists for {0}").format(comma_and(items)))
|
||||
|
||||
def on_trash(self):
|
||||
frappe.db.sql("""update `tabSupport Ticket` set lead='' where lead=%s""",
|
||||
frappe.db.sql("""update `tabIssue` set lead='' where lead=%s""",
|
||||
self.name)
|
||||
|
||||
self.delete_events()
|
||||
|
@ -278,7 +278,7 @@ class EmailDigest(Document):
|
||||
date_field="posting_date")
|
||||
|
||||
def get_new_support_tickets(self):
|
||||
return self.get_new_count("Support Ticket", self.meta.get_label("new_support_tickets"),
|
||||
return self.get_new_count("Issue", self.meta.get_label("new_support_tickets"),
|
||||
filter_by_company=False)
|
||||
|
||||
def get_new_communications(self):
|
||||
@ -454,7 +454,7 @@ class EmailDigest(Document):
|
||||
|
||||
def get_open_tickets(self):
|
||||
open_tickets = frappe.db.sql("""select name, subject, modified, raised_by
|
||||
from `tabSupport Ticket` where status='Open'
|
||||
from `tabIssue` where status='Open'
|
||||
order by modified desc limit 10""", as_dict=True)
|
||||
|
||||
if open_tickets:
|
||||
|
@ -7,7 +7,7 @@ import frappe
|
||||
def get_notification_config():
|
||||
return { "for_doctype":
|
||||
{
|
||||
"Support Ticket": {"status":"Open"},
|
||||
"Issue": {"status":"Open"},
|
||||
"Customer Issue": {"status":"Open"},
|
||||
"Task": {"status":"Open"},
|
||||
"Lead": {"status":"Open"},
|
||||
|
@ -287,7 +287,7 @@ data_map = {
|
||||
}
|
||||
},
|
||||
# Support
|
||||
"Support Ticket": {
|
||||
"Issue": {
|
||||
"columns": ["name","status","creation","resolution_date","first_responded_on"],
|
||||
"conditions": ["docstatus < 2"],
|
||||
"order_by": "creation"
|
||||
|
@ -1,5 +1,4 @@
|
||||
{
|
||||
"allow_attach": 1,
|
||||
"autoname": "naming_series:",
|
||||
"creation": "2013-02-01 10:36:25",
|
||||
"docstatus": 0,
|
||||
@ -218,15 +217,14 @@
|
||||
],
|
||||
"icon": "icon-ticket",
|
||||
"idx": 1,
|
||||
"modified": "2014-09-11 18:53:21.140997",
|
||||
"modified": "2014-11-28 11:38:35.978149",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Support",
|
||||
"name": "Support Ticket",
|
||||
"name": "Issue",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"amend": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 0,
|
||||
"email": 1,
|
||||
@ -240,7 +238,7 @@
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"cancel": 0,
|
||||
"apply_user_permissions": 1,
|
||||
"create": 1,
|
||||
"delete": 0,
|
||||
"email": 1,
|
||||
@ -254,7 +252,7 @@
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"cancel": 0,
|
||||
"apply_user_permissions": 1,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
@ -265,30 +263,6 @@
|
||||
"role": "Support Team",
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"cancel": 0,
|
||||
"create": 0,
|
||||
"delete": 0,
|
||||
"permlevel": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Support Team",
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"cancel": 0,
|
||||
"create": 0,
|
||||
"delete": 0,
|
||||
"permlevel": 2,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Support Team",
|
||||
"submit": 0,
|
||||
"write": 0
|
||||
}
|
||||
],
|
||||
"search_fields": "status,customer,subject,raised_by",
|
@ -8,7 +8,7 @@ from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import now
|
||||
|
||||
class SupportTicket(Document):
|
||||
class Issue(Document):
|
||||
def get_feed(self):
|
||||
return "{0}: {1}".format(_(self.status), self.subject)
|
||||
|
||||
@ -37,7 +37,7 @@ class SupportTicket(Document):
|
||||
frappe.db.get_default("company")
|
||||
|
||||
def update_status(self):
|
||||
status = frappe.db.get_value("Support Ticket", self.name, "status")
|
||||
status = frappe.db.get_value("Issue", self.name, "status")
|
||||
if self.status!="Open" and status =="Open" and not self.first_responded_on:
|
||||
self.first_responded_on = now()
|
||||
if self.status=="Closed" and status !="Closed":
|
||||
@ -48,11 +48,11 @@ class SupportTicket(Document):
|
||||
|
||||
@frappe.whitelist()
|
||||
def set_status(name, status):
|
||||
st = frappe.get_doc("Support Ticket", name)
|
||||
st = frappe.get_doc("Issue", name)
|
||||
st.status = status
|
||||
st.save()
|
||||
|
||||
def auto_close_tickets():
|
||||
frappe.db.sql("""update `tabSupport Ticket` set status = 'Closed'
|
||||
frappe.db.sql("""update `tabIssue` set status = 'Closed'
|
||||
where status = 'Replied'
|
||||
and date_sub(curdate(),interval 15 Day) > modified""")
|
@ -4,7 +4,7 @@
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
test_records = frappe.get_test_records('Support Ticket')
|
||||
test_records = frappe.get_test_records('Issue')
|
||||
|
||||
class TestSupportTicket(unittest.TestCase):
|
||||
class TestIssue(unittest.TestCase):
|
||||
pass
|
@ -1,7 +1,7 @@
|
||||
[
|
||||
{
|
||||
"doctype": "Support Ticket",
|
||||
"name": "_Test Support Ticket 1",
|
||||
"doctype": "Issue",
|
||||
"name": "_Test Issue 1",
|
||||
"subject": "Test Support",
|
||||
"raised_by": "test@example.com"
|
||||
}
|
@ -1 +0,0 @@
|
||||
Support Ticket (query) raised by customer via website or email (if configured).
|
@ -1,52 +0,0 @@
|
||||
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) {
|
||||
return{ query: "erpnext.controllers.queries.customer_query" } }
|
||||
|
||||
frappe.provide("erpnext.support");
|
||||
|
||||
cur_frm.add_fetch("customer", "customer_name", "customer_name")
|
||||
cur_frm.email_field = "raised_by";
|
||||
|
||||
$.extend(cur_frm.cscript, {
|
||||
refresh: function(doc) {
|
||||
erpnext.toggle_naming_series();
|
||||
if(!doc.__islocal) {
|
||||
if(cur_frm.fields_dict.status.get_status()=="Write") {
|
||||
if(doc.status!='Closed') cur_frm.add_custom_button(__('Close'),
|
||||
cur_frm.cscript['Close Ticket'], "icon-ok", "btn-success");
|
||||
if(doc.status=='Closed') cur_frm.add_custom_button(__('Re-Open Ticket'),
|
||||
cur_frm.cscript['Re-Open Ticket'], null, "btn-default");
|
||||
}
|
||||
|
||||
cur_frm.toggle_enable(["subject", "raised_by"], false);
|
||||
cur_frm.toggle_display("description", false);
|
||||
}
|
||||
refresh_field('status');
|
||||
},
|
||||
|
||||
'Close Ticket': function() {
|
||||
cur_frm.cscript.set_status("Closed");
|
||||
},
|
||||
|
||||
'Re-Open Ticket': function() {
|
||||
cur_frm.cscript.set_status("Open");
|
||||
},
|
||||
|
||||
set_status: function(status) {
|
||||
return frappe.call({
|
||||
method: "erpnext.support.doctype.support_ticket.support_ticket.set_status",
|
||||
args: {
|
||||
name: cur_frm.doc.name,
|
||||
status: status
|
||||
},
|
||||
callback: function(r) {
|
||||
if(!r.exc) cur_frm.reload_doc();
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
@ -1,4 +0,0 @@
|
||||
frappe.listview_settings['Support Ticket'] = {
|
||||
add_fields: ["subject", "status", "raised_by"],
|
||||
filters:[["status","=", "Open"]]
|
||||
};
|
@ -1 +1 @@
|
||||
Support Ticket volume, performance over time.
|
||||
Issue volume, performance over time.
|
@ -22,7 +22,7 @@ erpnext.SupportAnalytics = frappe.views.GridReportWithPlot.extend({
|
||||
page: wrapper,
|
||||
parent: $(wrapper).find('.layout-main'),
|
||||
appframe: wrapper.appframe,
|
||||
doctypes: ["Support Ticket", "Fiscal Year"],
|
||||
doctypes: ["Issue", "Fiscal Year"],
|
||||
});
|
||||
},
|
||||
|
||||
@ -64,7 +64,7 @@ erpnext.SupportAnalytics = frappe.views.GridReportWithPlot.extend({
|
||||
var total_responded = {};
|
||||
|
||||
|
||||
$.each(frappe.report_dump.data["Support Ticket"], function(i, d) {
|
||||
$.each(frappe.report_dump.data["Issue"], function(i, d) {
|
||||
var dateobj = dateutil.str_to_obj(d.creation);
|
||||
var date = d.creation.split(" ")[0];
|
||||
var col = me.column_map[date];
|
||||
|
@ -10,7 +10,7 @@ no_cache = 1
|
||||
no_sitemap = 1
|
||||
|
||||
def get_context(context):
|
||||
doc = frappe.get_doc("Support Ticket", frappe.form_dict.name)
|
||||
doc = frappe.get_doc("Issue", frappe.form_dict.name)
|
||||
if doc.raised_by == frappe.session.user:
|
||||
ticket_context = {
|
||||
"title": doc.name,
|
||||
@ -26,7 +26,7 @@ def add_reply(ticket, message):
|
||||
if not message:
|
||||
raise frappe.throw(_("Please write something"))
|
||||
|
||||
doc = frappe.get_doc("Support Ticket", ticket)
|
||||
doc = frappe.get_doc("Issue", ticket)
|
||||
if doc.raised_by != frappe.session.user:
|
||||
raise frappe.throw(_("You are not allowed to reply to this ticket."), frappe.PermissionError)
|
||||
|
||||
|
@ -20,7 +20,7 @@ def get_context(context):
|
||||
@frappe.whitelist()
|
||||
def get_tickets(start=0):
|
||||
tickets = frappe.db.sql("""select name, subject, status, creation
|
||||
from `tabSupport Ticket` where raised_by=%s
|
||||
from `tabIssue` where raised_by=%s
|
||||
order by modified desc
|
||||
limit %s, 20""", (frappe.session.user, cint(start)), as_dict=True)
|
||||
for t in tickets:
|
||||
@ -34,7 +34,7 @@ def make_new_ticket(subject, message):
|
||||
raise frappe.throw(_("Please write something in subject and message!"))
|
||||
|
||||
ticket = frappe.get_doc({
|
||||
"doctype":"Support Ticket",
|
||||
"doctype":"Issue",
|
||||
"subject": subject,
|
||||
"raised_by": frappe.session.user,
|
||||
})
|
||||
@ -46,7 +46,7 @@ def make_new_ticket(subject, message):
|
||||
"content": message,
|
||||
"sender": frappe.session.user,
|
||||
"sent_or_received": "Received",
|
||||
"reference_doctype": "Support Ticket",
|
||||
"reference_doctype": "Issue",
|
||||
"reference_name": ticket.name
|
||||
})
|
||||
comm.insert(ignore_permissions=True)
|
||||
|
@ -51,7 +51,7 @@ class Contact(StatusUpdater):
|
||||
self.is_primary_contact = 1
|
||||
|
||||
def on_trash(self):
|
||||
frappe.db.sql("""update `tabSupport Ticket` set contact='' where contact=%s""",
|
||||
frappe.db.sql("""update `tabIssue` set contact='' where contact=%s""",
|
||||
self.name)
|
||||
|
||||
@frappe.whitelist()
|
||||
|
Loading…
x
Reference in New Issue
Block a user