Fix Patch - remove company from patient (#11819)
diff --git a/erpnext/patches/v9_2/remove_company_from_patient.py b/erpnext/patches/v9_2/remove_company_from_patient.py
index ad9c9c5..1ce3445 100644
--- a/erpnext/patches/v9_2/remove_company_from_patient.py
+++ b/erpnext/patches/v9_2/remove_company_from_patient.py
@@ -1,5 +1,6 @@
import frappe
def execute():
- if 'company' in frappe.db.get_table_columns("Patient"):
- frappe.db.sql("alter table `tabPatient` drop column company")
+ if frappe.db.exists("DocType", "Patient"):
+ if 'company' in frappe.db.get_table_columns("Patient"):
+ frappe.db.sql("alter table `tabPatient` drop column company")