fixed to timesheet patch

This commit is contained in:
Rushabh Mehta 2013-03-04 15:45:46 +05:30
parent ac46aac46e
commit 5423c96bef
2 changed files with 7 additions and 2 deletions

View File

@ -5,7 +5,12 @@ def execute():
for name in webnotes.conn.sql_list("""select name from tabTimesheet"""):
ts = webnotes.bean("Timesheet", name)
for tsd in ts.doclist.get({"doctype":"Timesheet Detail"}):
tl = webnotes.bean({
if not webnotes.conn.exists("Project", tsd.project_name):
tsd.project_name = None
if not webnotes.conn.exists("Task", tsd.task_id):
tsd.task_id = None
tl = webnotes.doc({
"doctype": "Time Log",
"status": "Draft",
"from_time": ts.doc.timesheet_date + " " + tsd.act_start_time,

View File

@ -200,8 +200,8 @@ patch_list = [
'execute:webnotes.reload_doc("accounts", "Print Format", "Sales Invoice Modern") # 2013-02-26',
'execute:webnotes.reload_doc("accounts", "Print Format", "Sales Invoice Spartan") # 2013-02-26',
"execute:(not webnotes.conn.exists('Role', 'Projects Manager')) and webnotes.doc({'doctype':'Role', 'role_name':'Projects Manager'}).insert()",
"execute:(not webnotes.conn.exists('UOM', 'Hour')) and webnotes.doc({'uom_name': 'Unit', 'doctype': 'UOM', 'name': 'Hour'}).insert()",
"patches.february_2013.p09_remove_cancelled_warehouses",
"patches.march_2013.update_po_prevdoc_doctype",
"patches.february_2013.p09_timesheets",
"execute:(not webnotes.conn.exists('UOM', 'Hour')) and webnotes.doc({'uom_name': 'Hour', 'doctype': 'UOM', 'name': 'Hour'}).insert()",
]