From 9189653f2ea94bd21e5227608645aba34c78e34d Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Mon, 9 May 2022 10:11:52 +0530 Subject: [PATCH] fix: patch for renaming membership settings (#30929) --- erpnext/non_profit/workspace/non_profit/non_profit.json | 4 ++-- .../rename_membership_settings_to_non_profit_settings.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/erpnext/non_profit/workspace/non_profit/non_profit.json b/erpnext/non_profit/workspace/non_profit/non_profit.json index 2557d77d8819..8265fab798c7 100644 --- a/erpnext/non_profit/workspace/non_profit/non_profit.json +++ b/erpnext/non_profit/workspace/non_profit/non_profit.json @@ -109,7 +109,7 @@ "dependencies": "", "hidden": 0, "is_query_report": 0, - "label": "Membership Settings", + "label": "Non Profit Settings", "link_to": "Non Profit Settings", "link_type": "DocType", "onboard": 0, @@ -213,7 +213,7 @@ "type": "Link" } ], - "modified": "2021-03-11 11:38:09.140655", + "modified": "2022-05-09 11:38:09.140655", "modified_by": "Administrator", "module": "Non Profit", "name": "Non Profit", diff --git a/erpnext/patches/v13_0/rename_membership_settings_to_non_profit_settings.py b/erpnext/patches/v13_0/rename_membership_settings_to_non_profit_settings.py index 0e5423444aaa..9f75869d89bd 100644 --- a/erpnext/patches/v13_0/rename_membership_settings_to_non_profit_settings.py +++ b/erpnext/patches/v13_0/rename_membership_settings_to_non_profit_settings.py @@ -3,11 +3,11 @@ def execute(): - if frappe.db.table_exists("Membership Settings"): + if frappe.db.exists("DocType", "Membership Settings"): frappe.rename_doc("DocType", "Membership Settings", "Non Profit Settings") frappe.reload_doctype("Non Profit Settings", force=True) - if frappe.db.table_exists("Non Profit Settings"): + if frappe.db.exists("DocType", "Non Profit Settings"): rename_fields_map = { "enable_invoicing": "allow_invoicing", "create_for_web_forms": "automate_membership_invoicing", @@ -20,3 +20,5 @@ def execute(): for old_name, new_name in rename_fields_map.items(): rename_field("Non Profit Settings", old_name, new_name) + + frappe.delete_doc_if_exists("DocType", "Membership Settings")