fix(patch): delete hospitality custom fields (#29382)

This commit is contained in:
Ankush Menat 2022-01-20 19:42:08 +05:30 committed by GitHub
parent 180f06dae2
commit cce35c1536
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -326,7 +326,7 @@ erpnext.patches.v14_0.set_payroll_cost_centers
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

View File

@ -20,3 +20,13 @@ def execute():
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)