From 142f14dd5cdf68d56216a44f4687f2f61d26a05a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 2 Sep 2016 14:47:05 +0530 Subject: [PATCH 1/3] Migrate employee field to timesheet only if it exists in time log --- erpnext/patches/v7_0/update_missing_employee_in_timesheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/patches/v7_0/update_missing_employee_in_timesheet.py b/erpnext/patches/v7_0/update_missing_employee_in_timesheet.py index 57f518921b..54d492b265 100644 --- a/erpnext/patches/v7_0/update_missing_employee_in_timesheet.py +++ b/erpnext/patches/v7_0/update_missing_employee_in_timesheet.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe 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 tl.employee as employee, ts.name as name, tl.modified as modified, tl.modified_by as modified_by, tl.creation as creation, tl.owner as owner from From 54254cca58585592501168b315425a03693fc058 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 2 Sep 2016 16:17:42 +0530 Subject: [PATCH 2/3] Update set_party_name_in_payment_entry.py --- erpnext/patches/v7_0/set_party_name_in_payment_entry.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/patches/v7_0/set_party_name_in_payment_entry.py b/erpnext/patches/v7_0/set_party_name_in_payment_entry.py index c3085ce98c..bbdcf5cf3c 100644 --- a/erpnext/patches/v7_0/set_party_name_in_payment_entry.py +++ b/erpnext/patches/v7_0/set_party_name_in_payment_entry.py @@ -9,10 +9,12 @@ def execute(): customers = frappe._dict(frappe.db.sql("select name, customer_name from tabCustomer")) suppliers = frappe._dict(frappe.db.sql("select name, supplier_name from tabSupplier")) + frappe.reload_doc('accounts', 'doctype', 'payment_entry') + pe_list = frappe.db.sql("""select name, party_type, party from `tabPayment Entry` where party is not null and party != ''""", as_dict=1) for pe in pe_list: party_name = customers.get(pe.party) if pe.party_type=="Customer" else suppliers.get(pe.party) frappe.db.set_value("Payment Entry", pe.name, "party_name", party_name, update_modified=False) - \ No newline at end of file + From 533e5648674efab4e7ae7c30a8960ecf9c86631f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 2 Sep 2016 16:49:21 +0600 Subject: [PATCH 3/3] bumped to version 7.0.38 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index b9c80226d5..8177c2998c 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '7.0.37' +__version__ = '7.0.38' def get_default_company(user=None): '''Get default company for user'''