From 6aaa7d774299403b7fb9bfd7c3cc07ba6e7f47e1 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 7 Oct 2016 17:07:47 +0530 Subject: [PATCH 1/2] Added missing file extension --- .../v7_0/update_timesheet_communications.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 erpnext/patches/v7_0/update_timesheet_communications.py diff --git a/erpnext/patches/v7_0/update_timesheet_communications.py b/erpnext/patches/v7_0/update_timesheet_communications.py new file mode 100644 index 0000000000..203471ea8f --- /dev/null +++ b/erpnext/patches/v7_0/update_timesheet_communications.py @@ -0,0 +1,27 @@ +from __future__ import unicode_literals +import frappe + +def execute(): + if frappe.db.table_exists("Time Log"): + 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 + FROM + `tabTimesheet` ts, `tabTimesheet Detail` tsd, `tabTime Log` tl + WHERE + tsd.parent = ts.name AND tl.from_time = tsd.from_time AND tl.to_time = tsd.to_time + AND tl.hours = tsd.hours AND tl.billing_rate = tsd.billing_rate AND tsd.idx=1 + AND tl.docstatus < 2""", as_dict=1) + + 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(""" + update + tabCommunication + set + reference_doctype = "Timesheet", reference_name = %(timesheet)s + where + reference_doctype = "Time Log" and reference_name = %(timelog)s + """, {'timesheet': data.name, 'timelog': data.timelogname}, auto_commit=1) From 89326b366d171d854b918a5bc7828803a3c710be Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 7 Oct 2016 17:38:57 +0600 Subject: [PATCH 2/2] bumped to version 7.0.58 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index f86defe3f9..2dc7184a71 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '7.0.57' +__version__ = '7.0.58' def get_default_company(user=None): '''Get default company for user'''