From 4a37ee8908f13bda033248873617de76e74c0f0f Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Mon, 4 May 2020 11:09:19 +0530 Subject: [PATCH] fix(Healthcare): remove hardcoded UOM during Item creation for templates (#21575) --- .../clinical_procedure_template.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.py b/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.py index 00fad910a4f..69237847986 100644 --- a/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.py +++ b/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.py @@ -78,6 +78,8 @@ def create_item_from_template(doc): if doc.is_billable: disabled = 0 + uom = frappe.db.exists('UOM', 'Unit') or frappe.db.get_single_value('Stock Settings', 'stock_uom') + #insert item item = frappe.get_doc({ 'doctype': 'Item', @@ -92,7 +94,7 @@ def create_item_from_template(doc): 'show_in_website': 0, 'is_pro_applicable': 0, 'disabled': disabled, - 'stock_uom': 'Unit' + 'stock_uom': uom }).insert(ignore_permissions=True) #insert item price