2013-11-20 07:29:58 +00:00
|
|
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
2013-08-05 09:29:54 +00:00
|
|
|
# License: GNU General Public License v3. See license.txt
|
2013-05-21 11:47:40 +00:00
|
|
|
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
import webnotes
|
|
|
|
def execute():
|
2013-05-22 06:52:29 +00:00
|
|
|
webnotes.reload_doc("support", "doctype", "support_ticket")
|
|
|
|
webnotes.reload_doc("core", "doctype", "communication")
|
2013-05-21 11:47:40 +00:00
|
|
|
for d in webnotes.conn.sql("""select name, raised_by from `tabSupport Ticket`
|
|
|
|
where docstatus < 2""", as_dict=True):
|
|
|
|
tic = webnotes.get_obj("Support Ticket", d.name)
|
|
|
|
tic.set_lead_contact(d.raised_by)
|
|
|
|
webnotes.conn.sql("""update `tabSupport Ticket` set lead = %s, contact = %s, company = %s
|
2013-09-17 10:50:07 +00:00
|
|
|
where name = %s""", (tic.doc.lead, tic.doc.contact, tic.doc.company, d.name
|