blob: b61566f9b39242d8f90e185672806aeeec375b18 [file] [log] [blame]
Rushabh Mehtab21eb9a2013-02-28 18:42:46 +05301import webnotes
2
3def execute():
4 # convert timesheet details to time logs
5 for name in webnotes.conn.sql_list("""select name from tabTimesheet"""):
6 ts = webnotes.bean("Timesheet", name)
7 for tsd in ts.doclist.get({"doctype":"Timesheet Detail"}):
8 tl = webnotes.bean({
9 "doctype": "Time Log",
10 "status": "Draft",
11 "from_time": ts.doc.timesheet_date + " " + tsd.act_start_time,
12 "to_time": ts.doc.timesheet_date + " " + tsd.act_end_time,
13 "activity_type": tsd.activity_type,
14 "task": tsd.task_id,
15 "project": tsd.project_name,
16 "note": ts.doc.notes,
17 "file_list": ts.doc.file_list,
18 "_user_tags": ts.doc._user_tags
19 })
20 tl.insert()