Update update_timesheet_communications
This commit is contained in:
parent
0799969063
commit
2907881dfb
@ -2,7 +2,7 @@ from __future__ import unicode_literals
|
|||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
if frappe.db.table_exists("Time Log"):
|
if frappe.db.table_exists("Time Log") and "employee" in frappe.db.get_table_columns("Time Log"):
|
||||||
timesheet = frappe.db.sql("""SELECT ts.name AS name, tl.name AS timelogname,
|
timesheet = frappe.db.sql("""SELECT ts.name AS name, tl.name AS timelogname,
|
||||||
tl.modified AS modified, tl.modified_by AS modified_by, tl.creation AS creation, tl.owner AS owner
|
tl.modified AS modified, tl.modified_by AS modified_by, tl.creation AS creation, tl.owner AS owner
|
||||||
FROM
|
FROM
|
||||||
@ -13,6 +13,10 @@ def execute():
|
|||||||
AND tl.docstatus < 2""", as_dict=1)
|
AND tl.docstatus < 2""", as_dict=1)
|
||||||
|
|
||||||
for data in timesheet:
|
for data in timesheet:
|
||||||
|
frappe.db.sql(""" update `tabTimesheet` set creation = %(creation)s,
|
||||||
|
owner = %(owner)s, modified = %(modified)s, modified_by = %(modified_by)s
|
||||||
|
where name = %(name)s""", data)
|
||||||
|
|
||||||
frappe.db.sql("""
|
frappe.db.sql("""
|
||||||
update
|
update
|
||||||
tabCommunication
|
tabCommunication
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user