mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-17 02:26:33 +00:00
fix: Patch for Setting Missing Company in Healthcare DocTypes (#21790)
* fix: patch for setting missing company in Healthcare DocTypes * fix: check doctype exists Co-authored-by: Nabin Hait <nabinhait@gmail.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
company = frappe.db.get_single_value('Global Defaults', 'default_company')
|
||||
doctypes = ['Clinical Procedure', 'Inpatient Record', 'Lab Test', 'Patient Appointment', 'Patient Encounter', 'Vital Signs']
|
||||
for entry in doctypes:
|
||||
if frappe.db.exists('DocType', entry):
|
||||
frappe.db.sql("update `tab{dt}` set company = '{company}' where ifnull(company, '') = ''".format(dt=entry, company=company))
|
||||
Reference in New Issue
Block a user