[fix] fee component rename patch fix
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 662a260..5cb6a3b 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 @@
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