diff --git a/erpnext/config/support.py b/erpnext/config/support.py index 7e243b25cb..2ed2c5f9db 100644 --- a/erpnext/config/support.py +++ b/erpnext/config/support.py @@ -8,7 +8,7 @@ def get_data(): "items": [ { "type": "doctype", - "name": "Support Ticket", + "name": "Issue", "description": _("Support queries from customers."), }, { diff --git a/erpnext/hooks.py b/erpnext/hooks.py index f8fbca7e4b..39f253b611 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -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": { diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 5bcd3c21aa..c7d5e287eb 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -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) diff --git a/erpnext/patches/repair_tools/fix_naming_series_records_lost_by_reload.py b/erpnext/patches/repair_tools/fix_naming_series_records_lost_by_reload.py index 36fa277dea..7a19688243 100644 --- a/erpnext/patches/repair_tools/fix_naming_series_records_lost_by_reload.py +++ b/erpnext/patches/repair_tools/fix_naming_series_records_lost_by_reload.py @@ -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(): diff --git a/erpnext/patches/v4_0/reset_permissions_for_masters.py b/erpnext/patches/v4_0/reset_permissions_for_masters.py index 30aa47a61d..b0bc1230b0 100644 --- a/erpnext/patches/v4_0/reset_permissions_for_masters.py +++ b/erpnext/patches/v4_0/reset_permissions_for_masters.py @@ -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 diff --git a/erpnext/patches/v4_0/set_naming_series_property_setter.py b/erpnext/patches/v4_0/set_naming_series_property_setter.py index ffbfc24320..7ebcc1e1f0 100644 --- a/erpnext/patches/v4_0/set_naming_series_property_setter.py +++ b/erpnext/patches/v4_0/set_naming_series_property_setter.py @@ -29,7 +29,7 @@ doctype_series_map = { 'Stock Entry': 'STE-', 'Supplier': 'SUPP-', 'Supplier Quotation': 'SQTN-', - 'Support Ticket': 'SUP-' + 'Issue': 'SUP-' } def execute(): diff --git a/erpnext/selling/doctype/lead/lead.py b/erpnext/selling/doctype/lead/lead.py index 667a39fa05..21e0bbed69 100644 --- a/erpnext/selling/doctype/lead/lead.py +++ b/erpnext/selling/doctype/lead/lead.py @@ -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() diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py index bb9fb7e806..96f75c0a34 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -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: diff --git a/erpnext/startup/notifications.py b/erpnext/startup/notifications.py index c20e76040b..8109e92265 100644 --- a/erpnext/startup/notifications.py +++ b/erpnext/startup/notifications.py @@ -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"}, diff --git a/erpnext/startup/report_data_map.py b/erpnext/startup/report_data_map.py index 81d378cd18..b864cbc9e7 100644 --- a/erpnext/startup/report_data_map.py +++ b/erpnext/startup/report_data_map.py @@ -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" diff --git a/erpnext/support/doctype/support_ticket/__init__.py b/erpnext/support/doctype/issue/__init__.py similarity index 100% rename from erpnext/support/doctype/support_ticket/__init__.py rename to erpnext/support/doctype/issue/__init__.py diff --git a/erpnext/support/doctype/support_ticket/support_ticket.json b/erpnext/support/doctype/issue/issue.json similarity index 91% rename from erpnext/support/doctype/support_ticket/support_ticket.json rename to erpnext/support/doctype/issue/issue.json index 3a66c5ba3a..bd87f221b4 100644 --- a/erpnext/support/doctype/support_ticket/support_ticket.json +++ b/erpnext/support/doctype/issue/issue.json @@ -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", diff --git a/erpnext/support/doctype/support_ticket/support_ticket.py b/erpnext/support/doctype/issue/issue.py similarity index 88% rename from erpnext/support/doctype/support_ticket/support_ticket.py rename to erpnext/support/doctype/issue/issue.py index 4e24571761..2000ea059d 100644 --- a/erpnext/support/doctype/support_ticket/support_ticket.py +++ b/erpnext/support/doctype/issue/issue.py @@ -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""") diff --git a/erpnext/support/doctype/support_ticket/support_ticket_list.html b/erpnext/support/doctype/issue/issue_list.html similarity index 100% rename from erpnext/support/doctype/support_ticket/support_ticket_list.html rename to erpnext/support/doctype/issue/issue_list.html diff --git a/erpnext/support/doctype/support_ticket/test_support_ticket.py b/erpnext/support/doctype/issue/test_issue.py similarity index 59% rename from erpnext/support/doctype/support_ticket/test_support_ticket.py rename to erpnext/support/doctype/issue/test_issue.py index b5ce34af4b..da129eb09a 100644 --- a/erpnext/support/doctype/support_ticket/test_support_ticket.py +++ b/erpnext/support/doctype/issue/test_issue.py @@ -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 diff --git a/erpnext/support/doctype/support_ticket/test_records.json b/erpnext/support/doctype/issue/test_records.json similarity index 52% rename from erpnext/support/doctype/support_ticket/test_records.json rename to erpnext/support/doctype/issue/test_records.json index 30390b06d1..9c95bd30da 100644 --- a/erpnext/support/doctype/support_ticket/test_records.json +++ b/erpnext/support/doctype/issue/test_records.json @@ -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" } diff --git a/erpnext/support/doctype/support_ticket/README.md b/erpnext/support/doctype/support_ticket/README.md deleted file mode 100644 index 53e2fd7311..0000000000 --- a/erpnext/support/doctype/support_ticket/README.md +++ /dev/null @@ -1 +0,0 @@ -Support Ticket (query) raised by customer via website or email (if configured). \ No newline at end of file diff --git a/erpnext/support/doctype/support_ticket/support_ticket.js b/erpnext/support/doctype/support_ticket/support_ticket.js deleted file mode 100644 index 9bdc6f3c69..0000000000 --- a/erpnext/support/doctype/support_ticket/support_ticket.js +++ /dev/null @@ -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(); - } - }) - - } - -}) - diff --git a/erpnext/support/doctype/support_ticket/support_ticket_list.js b/erpnext/support/doctype/support_ticket/support_ticket_list.js deleted file mode 100644 index 1ae4d93708..0000000000 --- a/erpnext/support/doctype/support_ticket/support_ticket_list.js +++ /dev/null @@ -1,4 +0,0 @@ -frappe.listview_settings['Support Ticket'] = { - add_fields: ["subject", "status", "raised_by"], - filters:[["status","=", "Open"]] -}; diff --git a/erpnext/support/page/support_analytics/README.md b/erpnext/support/page/support_analytics/README.md index bc7654c1d8..2cb8acd713 100644 --- a/erpnext/support/page/support_analytics/README.md +++ b/erpnext/support/page/support_analytics/README.md @@ -1 +1 @@ -Support Ticket volume, performance over time. \ No newline at end of file +Issue volume, performance over time. \ No newline at end of file diff --git a/erpnext/support/page/support_analytics/support_analytics.js b/erpnext/support/page/support_analytics/support_analytics.js index 667602500a..9e24f679e1 100644 --- a/erpnext/support/page/support_analytics/support_analytics.js +++ b/erpnext/support/page/support_analytics/support_analytics.js @@ -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]; diff --git a/erpnext/templates/pages/ticket.py b/erpnext/templates/pages/ticket.py index 9582146ceb..2d52f3805c 100644 --- a/erpnext/templates/pages/ticket.py +++ b/erpnext/templates/pages/ticket.py @@ -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) diff --git a/erpnext/templates/pages/tickets.py b/erpnext/templates/pages/tickets.py index 539cde6df7..71839f25bf 100644 --- a/erpnext/templates/pages/tickets.py +++ b/erpnext/templates/pages/tickets.py @@ -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) diff --git a/erpnext/utilities/doctype/contact/contact.py b/erpnext/utilities/doctype/contact/contact.py index 28597efdcb..999ff68919 100644 --- a/erpnext/utilities/doctype/contact/contact.py +++ b/erpnext/utilities/doctype/contact/contact.py @@ -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()