From 9dd1e5d7289421ae7ee2772fd9d806d2e81cb40c Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 5 Jan 2012 17:39:42 +0530 Subject: [PATCH] Support Ticket Naming Series --- .../doctype/support_ticket/support_ticket.py | 4 +++ .../doctype/support_ticket/support_ticket.txt | 30 ++++++++++++------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/erpnext/support/doctype/support_ticket/support_ticket.py b/erpnext/support/doctype/support_ticket/support_ticket.py index c71304a0f7..709c7638a5 100644 --- a/erpnext/support/doctype/support_ticket/support_ticket.py +++ b/erpnext/support/doctype/support_ticket/support_ticket.py @@ -1,4 +1,5 @@ import webnotes +from webnotes.model.doc import make_autoname from utilities.transaction_base import TransactionBase from home import update_feed @@ -8,6 +9,9 @@ class DocType(TransactionBase): self.doc = doc self.doclist = doclist + def autoname(self): + self.doc.name = make_autoname(self.doc.naming_series+'.#####') + def send_response(self): """ Adds a new response to the ticket and sends an email to the sender diff --git a/erpnext/support/doctype/support_ticket/support_ticket.txt b/erpnext/support/doctype/support_ticket/support_ticket.txt index 0e3dee6590..bcdda149f0 100644 --- a/erpnext/support/doctype/support_ticket/support_ticket.txt +++ b/erpnext/support/doctype/support_ticket/support_ticket.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-05-23 10:00:38', + 'creation': '2011-05-23 12:37:01', 'docstatus': 0, - 'modified': '2011-12-27 17:40:25', + 'modified': '2012-01-05 16:29:45', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -15,8 +15,8 @@ '_last_update': '1311584009', 'allow_attach': 1, 'allow_trash': 1, - 'autoname': 'SUP.######', 'colour': 'White:FFF', + 'default_print_format': 'Standard', 'doctype': 'DocType', 'module': 'Support', 'name': '__common__', @@ -26,7 +26,7 @@ 'show_in_menu': 0, 'subject': '%(subject)s', 'tag_fields': 'status,allocated_to', - 'version': 149 + 'version': 153 }, # These values are common for all DocField @@ -41,6 +41,7 @@ # These values are common for all DocPerm { 'amend': 0, + 'cancel': 0, 'doctype': 'DocPerm', 'name': '__common__', 'parent': 'Support Ticket', @@ -58,7 +59,6 @@ # DocPerm { - 'cancel': 0, 'create': 1, 'doctype': 'DocPerm', 'permlevel': 0, @@ -68,7 +68,6 @@ # DocPerm { - 'cancel': 0, 'create': 1, 'doctype': 'DocPerm', 'permlevel': 0, @@ -78,7 +77,6 @@ # DocPerm { - 'cancel': 1, 'create': 1, 'doctype': 'DocPerm', 'permlevel': 0, @@ -88,7 +86,6 @@ # DocPerm { - 'cancel': 0, 'create': 0, 'doctype': 'DocPerm', 'permlevel': 1, @@ -98,7 +95,6 @@ # DocPerm { - 'cancel': 0, 'create': 0, 'doctype': 'DocPerm', 'permlevel': 2, @@ -187,7 +183,6 @@ 'doctype': 'DocField', 'fieldtype': 'Button', 'label': 'Send', - 'options': 'send_response', 'permlevel': 0 }, @@ -392,5 +387,20 @@ 'no_copy': 1, 'permlevel': 0, 'print_hide': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'naming_series', + 'fieldtype': 'Select', + 'hidden': 1, + 'label': 'Series', + 'no_copy': 1, + 'options': 'SUP', + 'permlevel': 0, + 'print_hide': 1, + 'reqd': 0, + 'search_index': 0 } ] \ No newline at end of file