brotherton-erpnext/patches/november_2012/customer_issue_allocated_to_assigned.py

19 lines
699 B
Python
Raw Normal View History

from __future__ import unicode_literals
import webnotes
def execute():
from webnotes.widgets.form.assign_to import add
2012-11-15 11:28:27 +00:00
# clear old customer issue todos
webnotes.conn.sql("""delete from tabToDo where reference_type='Customer Issue'""")
webnotes.conn.sql("""delete from tabComment where comment like '%Form/Customer Issue%'""")
for t in webnotes.conn.sql("""select * from `tabCustomer Issue`
2012-11-15 11:28:27 +00:00
where ifnull(allocated_to, '')!='' and ifnull(status, "")="Open" """, as_dict=1):
add({
'doctype': "Customer Issue",
'name': t['name'],
'assign_to': t['allocated_to'],
'assigned_by': t['owner'],
'description': t['complaint'],
2012-11-15 11:28:27 +00:00
'date': t['creation'],
'no_notification': True
})