fix(patch): delete hospitality custom fields (#29382)
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 981500e..e21671c 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -326,7 +326,7 @@
erpnext.patches.v13_0.agriculture_deprecation_warning
erpnext.patches.v14_0.delete_agriculture_doctypes
erpnext.patches.v13_0.hospitality_deprecation_warning
-erpnext.patches.v14_0.delete_hospitality_doctypes
+erpnext.patches.v14_0.delete_hospitality_doctypes # 20-01-2022
erpnext.patches.v13_0.update_exchange_rate_settings
erpnext.patches.v14_0.rearrange_company_fields
erpnext.patches.v14_0.update_leave_notification_template
diff --git a/erpnext/patches/v14_0/delete_hospitality_doctypes.py b/erpnext/patches/v14_0/delete_hospitality_doctypes.py
index 5bb5e4b..d0216f8 100644
--- a/erpnext/patches/v14_0/delete_hospitality_doctypes.py
+++ b/erpnext/patches/v14_0/delete_hospitality_doctypes.py
@@ -20,3 +20,13 @@
doctypes = frappe.get_all("DocType", {"module": module, "custom": 0}, pluck='name')
for doctype in doctypes:
frappe.delete_doc("DocType", doctype, ignore_missing=True)
+
+ custom_fields = [
+ {"dt": "Sales Invoice", "fieldname": "restaurant"},
+ {"dt": "Sales Invoice", "fieldname": "restaurant_table"},
+ {"dt": "Price List", "fieldname": "restaurant_menu"},
+ ]
+
+ for field in custom_fields:
+ custom_field = frappe.db.get_value("Custom Field", field)
+ frappe.delete_doc("Custom Field", custom_field, ignore_missing=True)