[fix] fee component rename patch fix

This commit is contained in:
Saurabh
2016-07-26 15:03:41 +05:30
parent 0540d52449
commit 21a5658fdf

View File

@@ -7,9 +7,10 @@ import frappe
from frappe.model.utils.rename_field import rename_field from frappe.model.utils.rename_field import rename_field
def execute(): def execute():
frappe.rename_doc("DocType", "Fee Amount", "Fee Component") if frappe.db.exists("DocType", "Fee Amount"):
for dt in ("Fees", "Fee Structure"): frappe.rename_doc("DocType", "Fee Amount", "Fee Component")
frappe.reload_doctype(dt) for dt in ("Fees", "Fee Structure"):
rename_field(dt, "amount", "components") frappe.reload_doctype(dt)
rename_field(dt, "amount", "components")