From f4d9af1ab9a48f6f60403ff1676eee245ec2f06a Mon Sep 17 00:00:00 2001 From: Jamsheer Date: Fri, 1 Dec 2017 16:10:39 +0530 Subject: [PATCH] Fix Patch - remove company from patient (#11819) --- erpnext/patches/v9_2/remove_company_from_patient.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/patches/v9_2/remove_company_from_patient.py b/erpnext/patches/v9_2/remove_company_from_patient.py index ad9c9c5fe0..1ce344501d 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")