refactored communication and added to Lead / Contact

This commit is contained in:
Rushabh Mehta 2012-11-27 18:53:48 +05:30
parent 1a0c61711c
commit dfcdd56ba5
2 changed files with 8 additions and 8 deletions

View File

@ -4,7 +4,7 @@
"docstatus": 0,
"creation": "2012-11-14 12:25:16",
"modified_by": "Administrator",
"modified": "2012-11-27 12:24:43"
"modified": "2012-11-27 18:51:01"
},
{
"autoname": "naming_series:",
@ -69,7 +69,7 @@
"label": "Content",
"width": "400",
"fieldname": "content",
"fieldtype": "Text",
"fieldtype": "Text Editor",
"reqd": 0,
"permlevel": 0
},

View File

@ -33,21 +33,21 @@ class DocType(TransactionBase):
return webnotes.conn.get_value('Email Settings',None,'support_email')
def get_subject(self, comm):
return '[' + self.doc.name + '] ' + (comm.doc.subject or 'No Subject Specified')
return '[' + self.doc.name + '] ' + (comm.subject or 'No Subject Specified')
def get_content(self, comm):
signature = webnotes.conn.get_value('Email Settings',None,'support_signature')
content = comm.doc.content
content = comm.content
if signature:
content += '<p>' + signature + '</p>'
return content
def on_communication_sent(self, comm):
webnotes.conn.set(self.doc, 'status', 'Waiting for Customer')
if comm.doc.lead and not self.doc.lead:
webnotes.conn.set(self.doc, 'lead', comm.doc.lead)
if comm.doc.contact and not self.doc.contact:
webnotes.conn.set(self.doc, 'contact', comm.doc.contact)
if comm.lead and not self.doc.lead:
webnotes.conn.set(self.doc, 'lead', comm.lead)
if comm.contact and not self.doc.contact:
webnotes.conn.set(self.doc, 'contact', comm.contact)
def close_ticket(self):
webnotes.conn.set(self.doc,'status','Closed')