From 5745cf7600396522e38fc6b40536cc1827af4dce Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 31 Mar 2015 17:31:53 +0530 Subject: [PATCH] fixed rename field patches --- erpnext/patches.txt | 2 +- erpnext/patches/v5_0/rename_table_fieldnames.py | 1 - erpnext/patches/v5_0/rename_total_fields.py | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index de517825a7..14ec93f833 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -85,6 +85,7 @@ execute:frappe.delete_doc("DocType", "Purchase Request Item") erpnext.patches.v4_2.recalculate_bom_cost erpnext.patches.v4_2.fix_gl_entries_for_stock_transactions erpnext.patches.v4_2.update_requested_and_ordered_qty +execute:frappe.rename_doc("DocType", "Support Ticket", "Issue", force=True) erpnext.patches.v4_4.make_email_accounts execute:frappe.delete_doc("DocType", "Contact Control") erpnext.patches.v4_2.discount_amount @@ -94,7 +95,6 @@ erpnext.patches.v5_0.update_dn_against_doc_fields execute:frappe.db.sql("update `tabMaterial Request` set material_request_type = 'Material Transfer' where material_request_type = 'Transfer'") execute:frappe.reload_doc('stock', 'doctype', 'item') execute:frappe.db.sql("update `tabItem` i set apply_warehouse_wise_reorder_level=1, re_order_level=0, re_order_qty=0 where exists(select name from `tabItem Reorder` where parent=i.name)") -execute:frappe.rename_doc("DocType", "Support Ticket", "Issue", force=True) erpnext.patches.v5_0.set_default_company_in_bom erpnext.patches.v5_0.capacity_planning execute:frappe.reload_doc('crm', 'doctype', 'lead') diff --git a/erpnext/patches/v5_0/rename_table_fieldnames.py b/erpnext/patches/v5_0/rename_table_fieldnames.py index 640d67874f..ca92c28790 100644 --- a/erpnext/patches/v5_0/rename_table_fieldnames.py +++ b/erpnext/patches/v5_0/rename_table_fieldnames.py @@ -228,7 +228,6 @@ def execute(): frappe.reload_doc("stock", "doctype", "item_variant") frappe.reload_doc("accounts", "doctype", "party_account") frappe.reload_doc("accounts", "doctype", "fiscal_year_company") - frappe.reload_doc("workflow", "doctype", "workflow") #rename table fieldnames for dn in rename_map: diff --git a/erpnext/patches/v5_0/rename_total_fields.py b/erpnext/patches/v5_0/rename_total_fields.py index 04b191e1ea..cf95caa708 100644 --- a/erpnext/patches/v5_0/rename_total_fields.py +++ b/erpnext/patches/v5_0/rename_total_fields.py @@ -41,12 +41,12 @@ buying_renamed_fields = ( def execute(): for doctypes, fields in [[selling_doctypes, selling_renamed_fields], [buying_doctypes, buying_renamed_fields]]: for dt in doctypes: - meta = frappe.get_meta(dt) frappe.reload_doc(get_doctype_module(dt), "doctype", scrub(dt)) + table_columns = frappe.db.get_table_columns(dt) base_net_total = frappe.db.sql("select sum(ifnull({0}, 0)) from `tab{1}`".format(fields[0][1], dt))[0][0] if not base_net_total: for f in fields: - if meta.get_field(f[0]): + if f[0] in table_columns: rename_field(dt, f[0], f[1]) # Added new field "total_taxes_and_charges" in buying cycle, updating value