From 21a5658fdfe96dadb22cb3acc94b697d5ed50737 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Tue, 26 Jul 2016 15:03:41 +0530 Subject: [PATCH] [fix] fee component rename patch fix --- .../patches/v7_0/rename_fee_amount_to_fee_component.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/erpnext/patches/v7_0/rename_fee_amount_to_fee_component.py b/erpnext/patches/v7_0/rename_fee_amount_to_fee_component.py index 662a260753..5cb6a3b7c4 100644 --- a/erpnext/patches/v7_0/rename_fee_amount_to_fee_component.py +++ b/erpnext/patches/v7_0/rename_fee_amount_to_fee_component.py @@ -7,9 +7,10 @@ import frappe from frappe.model.utils.rename_field import rename_field def execute(): - frappe.rename_doc("DocType", "Fee Amount", "Fee Component") - for dt in ("Fees", "Fee Structure"): - frappe.reload_doctype(dt) - rename_field(dt, "amount", "components") + if frappe.db.exists("DocType", "Fee Amount"): + frappe.rename_doc("DocType", "Fee Amount", "Fee Component") + for dt in ("Fees", "Fee Structure"): + frappe.reload_doctype(dt) + rename_field(dt, "amount", "components") \ No newline at end of file