fix: delete unused custom fields from web form
This commit is contained in:
@@ -1,12 +1,23 @@
|
|||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
if "payments" not in frappe.get_installed_apps():
|
if "payments" not in frappe.get_installed_apps():
|
||||||
web_form_custom_fields = frappe.get_all("Custom Field", {
|
web_form_custom_fields = frappe.get_all(
|
||||||
"dt": "Web Form"
|
"Custom Field", {"dt": "Web Form"}, ["name", "fieldname"]
|
||||||
}, ["name", "fieldname"])
|
)
|
||||||
|
|
||||||
unused_fields = ["currency", "amount_field", "amount_based_on_field", "payment_button_help", "amount", "payments_cb", "payment_button_label", "payment_gateway", "payments_tab"]
|
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:
|
for field in web_form_custom_fields:
|
||||||
if field.fieldname in unused_fields:
|
if field.fieldname in unused_fields:
|
||||||
|
|||||||
Reference in New Issue
Block a user