brotherton-erpnext/patches/november_2012/customer_issue_allocated_to_assigned.py
2012-11-15 15:11:15 +05:30

15 lines
430 B
Python

from __future__ import unicode_literals
import webnotes
def execute():
from webnotes.widgets.form.assign_to import add
for t in webnotes.conn.sql("""select * from `tabCustomer Issue`
where ifnull(allocated_to, '')!=''""", as_dict=1):
add({
'doctype': "Customer Issue",
'name': t['name'],
'assign_to': t['allocated_to'],
'assigned_by': t['owner'],
'description': t['complaint'],
'date': t['creation']
})