support ticket - customer details display fixed
diff --git a/maintenance/doctype/support_ticket/support_ticket.js b/maintenance/doctype/support_ticket/support_ticket.js
index c723d66..3e43edc 100644
--- a/maintenance/doctype/support_ticket/support_ticket.js
+++ b/maintenance/doctype/support_ticket/support_ticket.js
@@ -27,6 +27,8 @@
]
})
}
+
+ if(!doc.customer) hide_field(['customer_name','address_display','contact_display','contact_mobile','contact_email']);
},
refresh: function(doc) {
@@ -76,6 +78,15 @@
refresh_field('new_response');
cs.make_listing(doc);
});
+ },
+
+ customer: function(doc, dt, dn) {
+ var callback = function(r,rt) {
+ var doc = locals[cur_frm.doctype][cur_frm.docname];
+ cur_frm.refresh();
+ }
+ if(doc.customer) $c_obj(make_doclist(doc.doctype, doc.name), 'get_default_customer_address', '', callback);
+ if(doc.customer) unhide_field(['customer_name','address_display','contact_display','contact_mobile','contact_email']);
}
})
@@ -125,4 +136,4 @@
}
this.make();
-}
\ No newline at end of file
+}
diff --git a/maintenance/doctype/support_ticket/support_ticket.py b/maintenance/doctype/support_ticket/support_ticket.py
index f611765..c4af0ed 100644
--- a/maintenance/doctype/support_ticket/support_ticket.py
+++ b/maintenance/doctype/support_ticket/support_ticket.py
@@ -1,6 +1,8 @@
import webnotes
-class DocType:
+from utilities.transaction_base import TransactionBase
+
+class DocType(TransactionBase):
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist
diff --git a/maintenance/doctype/support_ticket/support_ticket.txt b/maintenance/doctype/support_ticket/support_ticket.txt
index ebb4043..983f544 100644
--- a/maintenance/doctype/support_ticket/support_ticket.txt
+++ b/maintenance/doctype/support_ticket/support_ticket.txt
@@ -1,6 +1,6 @@
[
{
- '_last_update': '1306413048',
+ '_last_update': '1308898257',
'allow_attach': None,
'allow_copy': None,
'allow_email': None,
@@ -13,7 +13,7 @@
'client_script_core': None,
'client_string': None,
'colour': 'White:FFF',
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'description': None,
'docstatus': 0,
'doctype': 'DocType',
@@ -29,7 +29,7 @@
'istable': None,
'max_attachments': None,
'menu_index': None,
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
'module': 'Maintenance',
'name': 'Support Ticket',
@@ -53,21 +53,21 @@
'subject': '%(subject)s',
'tag_fields': 'status',
'use_template': None,
- 'version': 138
+ 'version': 140
},
{
'amend': 0,
'cancel': 0,
'create': 1,
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'docstatus': 0,
'doctype': 'DocPerm',
'execute': None,
'idx': 1,
'match': None,
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'PERM00838',
+ 'name': 'PERM00823',
'owner': 'Administrator',
'parent': 'Support Ticket',
'parentfield': 'permissions',
@@ -82,15 +82,15 @@
'amend': None,
'cancel': None,
'create': 1,
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'docstatus': 0,
'doctype': 'DocPerm',
'execute': None,
'idx': 2,
'match': 'customer',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'PERM00839',
+ 'name': 'PERM00824',
'owner': 'Administrator',
'parent': 'Support Ticket',
'parentfield': 'permissions',
@@ -105,15 +105,15 @@
'amend': None,
'cancel': 1,
'create': 1,
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'docstatus': 0,
'doctype': 'DocPerm',
'execute': None,
'idx': 3,
'match': None,
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'PERM00840',
+ 'name': 'PERM00825',
'owner': 'Administrator',
'parent': 'Support Ticket',
'parentfield': 'permissions',
@@ -128,15 +128,15 @@
'amend': None,
'cancel': 0,
'create': 0,
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'docstatus': 0,
'doctype': 'DocPerm',
'execute': None,
'idx': 4,
'match': 'allocated_to',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'PERM00841',
+ 'name': 'PERM00826',
'owner': 'Administrator',
'parent': 'Support Ticket',
'parentfield': 'permissions',
@@ -151,15 +151,15 @@
'amend': None,
'cancel': None,
'create': None,
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'docstatus': 0,
'doctype': 'DocPerm',
'execute': None,
'idx': 5,
'match': None,
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'PERM00842',
+ 'name': 'PERM00827',
'owner': 'Administrator',
'parent': 'Support Ticket',
'parentfield': 'permissions',
@@ -173,7 +173,7 @@
{
'allow_on_submit': None,
'colour': 'White:FFF',
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'default': 'Open',
'depends_on': None,
'description': None,
@@ -186,9 +186,9 @@
'idx': 1,
'in_filter': 0,
'label': 'Status',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05022',
+ 'name': 'FL04803',
'no_column': None,
'no_copy': 1,
'oldfieldname': 'status',
@@ -209,7 +209,7 @@
{
'allow_on_submit': None,
'colour': None,
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'default': None,
'depends_on': None,
'description': None,
@@ -222,9 +222,9 @@
'idx': 2,
'in_filter': 1,
'label': 'Subject',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05023',
+ 'name': 'FL04804',
'no_column': None,
'no_copy': None,
'oldfieldname': None,
@@ -245,7 +245,7 @@
{
'allow_on_submit': None,
'colour': None,
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'default': None,
'depends_on': 'eval:doc.__islocal',
'description': None,
@@ -258,9 +258,9 @@
'idx': 3,
'in_filter': 1,
'label': 'Raised By (Email)',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05024',
+ 'name': 'FL04805',
'no_column': None,
'no_copy': None,
'oldfieldname': 'raised_by',
@@ -281,7 +281,7 @@
{
'allow_on_submit': None,
'colour': None,
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'default': None,
'depends_on': 'eval:doc.__islocal',
'description': None,
@@ -294,9 +294,9 @@
'idx': 4,
'in_filter': None,
'label': 'Description',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05025',
+ 'name': 'FL04806',
'no_column': None,
'no_copy': None,
'oldfieldname': 'problem_description',
@@ -317,7 +317,7 @@
{
'allow_on_submit': None,
'colour': None,
- 'creation': '2011-05-28 10:12:57',
+ 'creation': '2011-05-27 13:07:26',
'default': None,
'depends_on': None,
'description': None,
@@ -330,9 +330,9 @@
'idx': 5,
'in_filter': None,
'label': 'Problem Description',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05475',
+ 'name': 'FL05248',
'no_column': None,
'no_copy': None,
'oldfieldname': 'problem_description',
@@ -353,7 +353,7 @@
{
'allow_on_submit': None,
'colour': None,
- 'creation': '2011-05-28 10:26:08',
+ 'creation': '2011-06-24 11:54:03',
'default': None,
'depends_on': 'eval:!doc.__islocal',
'description': None,
@@ -366,9 +366,9 @@
'idx': 6,
'in_filter': None,
'label': 'Thread HTML',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05530',
+ 'name': 'FL05356',
'no_column': None,
'no_copy': None,
'oldfieldname': None,
@@ -389,7 +389,7 @@
{
'allow_on_submit': None,
'colour': None,
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'default': None,
'depends_on': 'eval:!doc.__islocal',
'description': None,
@@ -402,9 +402,9 @@
'idx': 7,
'in_filter': None,
'label': 'New Response',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05027',
+ 'name': 'FL04808',
'no_column': None,
'no_copy': None,
'oldfieldname': None,
@@ -425,7 +425,7 @@
{
'allow_on_submit': None,
'colour': None,
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'default': None,
'depends_on': 'eval:!doc.__islocal',
'description': None,
@@ -438,9 +438,9 @@
'idx': 8,
'in_filter': None,
'label': 'Send',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05028',
+ 'name': 'FL04809',
'no_column': None,
'no_copy': None,
'oldfieldname': None,
@@ -461,7 +461,7 @@
{
'allow_on_submit': None,
'colour': 'White:FFF',
- 'creation': '2011-05-28 10:26:09',
+ 'creation': '2011-06-24 11:54:03',
'default': None,
'depends_on': None,
'description': None,
@@ -474,9 +474,9 @@
'idx': 9,
'in_filter': None,
'label': 'Additional Info',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05531',
+ 'name': 'FL05357',
'no_column': None,
'no_copy': None,
'oldfieldname': None,
@@ -497,7 +497,7 @@
{
'allow_on_submit': None,
'colour': None,
- 'creation': '2011-05-28 10:26:09',
+ 'creation': '2011-06-24 11:54:03',
'default': None,
'depends_on': 'eval:!doc.__islocal',
'description': None,
@@ -510,9 +510,9 @@
'idx': 10,
'in_filter': None,
'label': None,
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05532',
+ 'name': 'FL05358',
'no_column': None,
'no_copy': None,
'oldfieldname': None,
@@ -533,7 +533,7 @@
{
'allow_on_submit': None,
'colour': 'White:FFF',
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'default': None,
'depends_on': None,
'description': None,
@@ -546,9 +546,9 @@
'idx': 11,
'in_filter': 1,
'label': 'Customer',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05031',
+ 'name': 'FL04812',
'no_column': None,
'no_copy': None,
'oldfieldname': 'customer',
@@ -569,7 +569,7 @@
{
'allow_on_submit': None,
'colour': None,
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'default': None,
'depends_on': None,
'description': None,
@@ -582,9 +582,9 @@
'idx': 12,
'in_filter': 1,
'label': 'Customer Name',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05032',
+ 'name': 'FL04813',
'no_column': None,
'no_copy': None,
'oldfieldname': 'customer_name',
@@ -594,7 +594,7 @@
'parent': 'Support Ticket',
'parentfield': 'fields',
'parenttype': 'DocType',
- 'permlevel': 1,
+ 'permlevel': 2,
'print_hide': None,
'report_hide': None,
'reqd': 0,
@@ -605,32 +605,32 @@
{
'allow_on_submit': None,
'colour': None,
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-06-24 12:20:56',
'default': None,
'depends_on': None,
'description': None,
'docstatus': 0,
'doctype': 'DocField',
- 'fieldname': 'contact_no',
- 'fieldtype': 'Data',
+ 'fieldname': 'address_display',
+ 'fieldtype': 'Small Text',
'hidden': None,
'icon': None,
'idx': 13,
'in_filter': None,
- 'label': 'Contact No',
- 'modified': '2011-06-20 13:46:30',
+ 'label': 'Address',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05033',
+ 'name': 'FL05399',
'no_column': None,
'no_copy': None,
- 'oldfieldname': 'contact_no',
- 'oldfieldtype': 'Data',
+ 'oldfieldname': None,
+ 'oldfieldtype': None,
'options': None,
'owner': 'Administrator',
'parent': 'Support Ticket',
'parentfield': 'fields',
'parenttype': 'DocType',
- 'permlevel': 1,
+ 'permlevel': 2,
'print_hide': None,
'report_hide': None,
'reqd': None,
@@ -641,7 +641,115 @@
{
'allow_on_submit': None,
'colour': None,
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-06-24 12:20:56',
+ 'default': None,
+ 'depends_on': None,
+ 'description': None,
+ 'docstatus': 0,
+ 'doctype': 'DocField',
+ 'fieldname': 'contact_display',
+ 'fieldtype': 'Data',
+ 'hidden': None,
+ 'icon': None,
+ 'idx': 14,
+ 'in_filter': None,
+ 'label': 'Contact Name',
+ 'modified': '2011-06-24 12:24:09',
+ 'modified_by': 'Administrator',
+ 'name': 'FL05401',
+ 'no_column': None,
+ 'no_copy': None,
+ 'oldfieldname': None,
+ 'oldfieldtype': None,
+ 'options': None,
+ 'owner': 'Administrator',
+ 'parent': 'Support Ticket',
+ 'parentfield': 'fields',
+ 'parenttype': 'DocType',
+ 'permlevel': 2,
+ 'print_hide': None,
+ 'report_hide': None,
+ 'reqd': None,
+ 'search_index': None,
+ 'trigger': None,
+ 'width': None
+ },
+ {
+ 'allow_on_submit': None,
+ 'colour': None,
+ 'creation': '2011-06-24 12:20:56',
+ 'default': None,
+ 'depends_on': None,
+ 'description': None,
+ 'docstatus': 0,
+ 'doctype': 'DocField',
+ 'fieldname': 'contact_mobile',
+ 'fieldtype': 'Data',
+ 'hidden': None,
+ 'icon': None,
+ 'idx': 15,
+ 'in_filter': None,
+ 'label': 'Mobile No',
+ 'modified': '2011-06-24 12:24:09',
+ 'modified_by': 'Administrator',
+ 'name': 'FL05400',
+ 'no_column': None,
+ 'no_copy': None,
+ 'oldfieldname': None,
+ 'oldfieldtype': None,
+ 'options': None,
+ 'owner': 'Administrator',
+ 'parent': 'Support Ticket',
+ 'parentfield': 'fields',
+ 'parenttype': 'DocType',
+ 'permlevel': 2,
+ 'print_hide': None,
+ 'report_hide': None,
+ 'reqd': None,
+ 'search_index': None,
+ 'trigger': None,
+ 'width': None
+ },
+ {
+ 'allow_on_submit': None,
+ 'colour': None,
+ 'creation': '2011-05-23 10:18:58',
+ 'default': None,
+ 'depends_on': None,
+ 'description': None,
+ 'docstatus': 0,
+ 'doctype': 'DocField',
+ 'fieldname': 'contact_email',
+ 'fieldtype': 'Data',
+ 'hidden': None,
+ 'icon': None,
+ 'idx': 16,
+ 'in_filter': None,
+ 'label': 'Contact Email',
+ 'modified': '2011-06-24 12:24:09',
+ 'modified_by': 'Administrator',
+ 'name': 'FL04814',
+ 'no_column': None,
+ 'no_copy': None,
+ 'oldfieldname': 'contact_no',
+ 'oldfieldtype': 'Data',
+ 'options': None,
+ 'owner': 'Administrator',
+ 'parent': 'Support Ticket',
+ 'parentfield': 'fields',
+ 'parenttype': 'DocType',
+ 'permlevel': 2,
+ 'print_hide': None,
+ 'report_hide': None,
+ 'reqd': None,
+ 'search_index': None,
+ 'trigger': None,
+ 'width': None
+ },
+ {
+ 'allow_on_submit': None,
+ 'colour': None,
+ 'creation': '2011-05-23 10:18:58',
'default': 'Today',
'depends_on': None,
'description': None,
@@ -651,12 +759,12 @@
'fieldtype': 'Date',
'hidden': None,
'icon': None,
- 'idx': 14,
+ 'idx': 17,
'in_filter': None,
'label': 'Opening Date',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05034',
+ 'name': 'FL04815',
'no_column': None,
'no_copy': 1,
'oldfieldname': 'opening_date',
@@ -677,7 +785,7 @@
{
'allow_on_submit': None,
'colour': None,
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'default': None,
'depends_on': None,
'description': None,
@@ -687,12 +795,12 @@
'fieldtype': 'Time',
'hidden': None,
'icon': None,
- 'idx': 15,
+ 'idx': 18,
'in_filter': None,
'label': 'Opening Time',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05035',
+ 'name': 'FL04816',
'no_column': None,
'no_copy': 1,
'oldfieldname': 'opening_time',
@@ -713,7 +821,7 @@
{
'allow_on_submit': None,
'colour': None,
- 'creation': '2011-05-28 10:26:09',
+ 'creation': '2011-06-24 11:54:03',
'default': None,
'depends_on': 'eval:!doc.__islocal',
'description': None,
@@ -723,12 +831,12 @@
'fieldtype': 'Column Break',
'hidden': None,
'icon': None,
- 'idx': 16,
+ 'idx': 19,
'in_filter': None,
'label': None,
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05533',
+ 'name': 'FL05359',
'no_column': None,
'no_copy': None,
'oldfieldname': None,
@@ -749,7 +857,7 @@
{
'allow_on_submit': None,
'colour': None,
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'default': None,
'depends_on': 'eval:!doc.__islocal',
'description': None,
@@ -759,12 +867,12 @@
'fieldtype': 'Link',
'hidden': None,
'icon': None,
- 'idx': 17,
+ 'idx': 20,
'in_filter': 1,
'label': 'Allocated To',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05037',
+ 'name': 'FL04818',
'no_column': None,
'no_copy': None,
'oldfieldname': 'allocated_to',
@@ -785,7 +893,7 @@
{
'allow_on_submit': None,
'colour': None,
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'default': None,
'depends_on': 'eval:!doc.__islocal',
'description': None,
@@ -795,12 +903,12 @@
'fieldtype': 'Text',
'hidden': None,
'icon': None,
- 'idx': 18,
+ 'idx': 21,
'in_filter': None,
'label': 'Resolution Details',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05038',
+ 'name': 'FL04819',
'no_column': None,
'no_copy': 1,
'oldfieldname': 'resolution_details',
@@ -821,7 +929,7 @@
{
'allow_on_submit': None,
'colour': None,
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'default': None,
'depends_on': 'eval:!doc.__islocal',
'description': None,
@@ -831,12 +939,12 @@
'fieldtype': 'Date',
'hidden': None,
'icon': None,
- 'idx': 19,
+ 'idx': 22,
'in_filter': 0,
'label': 'Resolution Date',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05039',
+ 'name': 'FL04820',
'no_column': None,
'no_copy': 1,
'oldfieldname': 'resolution_date',
@@ -857,7 +965,7 @@
{
'allow_on_submit': None,
'colour': None,
- 'creation': '2011-05-23 14:50:46',
+ 'creation': '2011-05-23 10:18:58',
'default': None,
'depends_on': 'eval:!doc.__islocal',
'description': None,
@@ -867,12 +975,12 @@
'fieldtype': 'Time',
'hidden': None,
'icon': None,
- 'idx': 20,
+ 'idx': 23,
'in_filter': None,
'label': 'Resolution Time',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05040',
+ 'name': 'FL04821',
'no_column': None,
'no_copy': None,
'oldfieldname': 'resolution_time',
@@ -893,7 +1001,7 @@
{
'allow_on_submit': None,
'colour': 'White:FFF',
- 'creation': '2011-05-28 10:12:58',
+ 'creation': '2011-05-27 13:07:26',
'default': None,
'depends_on': None,
'description': None,
@@ -903,12 +1011,12 @@
'fieldtype': 'Data',
'hidden': 1,
'icon': None,
- 'idx': 21,
+ 'idx': 24,
'in_filter': None,
'label': 'Content Type',
- 'modified': '2011-06-20 13:46:30',
+ 'modified': '2011-06-24 12:24:09',
'modified_by': 'Administrator',
- 'name': 'FL05478',
+ 'name': 'FL05251',
'no_column': None,
'no_copy': None,
'oldfieldname': None,