support ticket response deprecated, moved to communication

This commit is contained in:
Rushabh Mehta
2012-11-24 15:26:48 +05:30
parent 36774bdcbb
commit bf09c672cd
11 changed files with 1270 additions and 1464 deletions

View File

@@ -0,0 +1,26 @@
import webnotes
import email.utils
def execute():
webnotes.conn.commit()
for d in webnotes.conn.sql("""select owner, creation, modified, modified_by, parent,
from_email, mail from `tabSupport Ticket Response`""", as_dict=1):
c = webnotes.doc("Communication")
c.creation = d.creation
c.owner = d.owner
c.modified = d.modified
c.modified_by = d.modified_by
c.naming_series = "COMM-"
c.subject = "response to Support Ticket: " + d.parent
c.content = d.mail
c.email_address = d.from_email
c.support_ticket = d.parent
email_addr = email.utils.parseaddr(c.email_address)[1]
c.contact = webnotes.conn.get_value("Contact", {"email_id": email_addr}, "name") or None
c.lead = webnotes.conn.get_value("Lead", {"email_id": email_addr}, "name") or None
c.communication_medium = "Email"
webnotes.conn.begin()
c.save(1, keep_timestamps=True)
webnotes.conn.commit()
webnotes.delete_doc("DocType", "Support Ticket Response")

View File

@@ -679,4 +679,8 @@ patch_list = [
'patch_module': 'patches.november_2012',
'patch_file': 'remove_old_unbilled_items_report',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'support_ticket_response_to_communication',
},
]