fix: delete unused custom fields from web form

This commit is contained in:
Jannat Patel
2025-02-13 17:21:14 +05:30
parent 5ab9131629
commit 75cea1ab78
3 changed files with 15 additions and 505 deletions

View File

@@ -0,0 +1,13 @@
import frappe
def execute():
if "payments" not in frappe.get_installed_apps():
web_form_custom_fields = frappe.get_all("Custom Field", {
"dt": "Web Form"
}, ["name", "fieldname"])
unused_fields = ["currency", "amount_field", "amount_based_on_field", "payment_button_help", "amount", "payments_cb", "payment_button_label", "payment_gateway", "payments_tab"]
for field in web_form_custom_fields:
if field.fieldname in unused_fields:
frappe.delete_doc("Custom Field", field.name)