[support ticket] clear assign to on closing ticket

This commit is contained in:
Anand Doshi 2013-04-29 16:36:59 +05:30
parent fe5fb33cc2
commit fe9c1eb5df
2 changed files with 9 additions and 9 deletions

View File

@ -29,17 +29,13 @@ $.extend(cur_frm.cscript, {
erpnext.hide_naming_series();
cur_frm.cscript.make_listing(doc);
if(!doc.__islocal) {
if(in_list(user_roles,'System Manager')) {
if(doc.status!='Closed') cur_frm.add_custom_button('Close Ticket', cur_frm.cscript['Close Ticket']);
if(doc.status=='Closed') cur_frm.add_custom_button('Re-Open Ticket', cur_frm.cscript['Re-Open Ticket']);
}else if(doc.allocated_to) {
cur_frm.set_df_property('status','read_only', 1);
if(user==doc.allocated_to && doc.status!='Closed') cur_frm.add_custom_button('Close Ticket', cur_frm.cscript['Close Ticket']);
if(user_roles.indexOf("Support Manager")!==-1) {
if(doc.status!='Closed') cur_frm.add_custom_button('Close Ticket', cur_frm.cscript['Close Ticket']);
if(doc.status=='Closed') cur_frm.add_custom_button('Re-Open Ticket', cur_frm.cscript['Re-Open Ticket']);
}
cur_frm.set_df_property('subject','read_only', 1);
cur_frm.set_df_property('description','hidden', 1);
cur_frm.set_df_property('raised_by','read_only', 1);
cur_frm.toggle_enable(["subject", "raised_by"], false);
cur_frm.toggle_display("description", false);
}
refresh_field('status');
},

View File

@ -45,6 +45,10 @@ class DocType(TransactionBase):
def validate(self):
self.update_status()
if self.doc.status == "Closed":
from webnotes.widgets.form.assign_to import clear
clear(self.doc.doctype, self.doc.name)
def on_communication_sent(self, comm):
webnotes.conn.set(self.doc, 'status', 'Waiting for Customer')
if comm.lead and not self.doc.lead: