fix(Healthcare): remove hardcoded UOM during Item creation for templates (#21575)

This commit is contained in:
Rucha Mahabal
2020-05-04 11:09:19 +05:30
committed by GitHub
parent bdbfd2ad0c
commit 4a37ee8908

View File

@@ -78,6 +78,8 @@ def create_item_from_template(doc):
if doc.is_billable: if doc.is_billable:
disabled = 0 disabled = 0
uom = frappe.db.exists('UOM', 'Unit') or frappe.db.get_single_value('Stock Settings', 'stock_uom')
#insert item #insert item
item = frappe.get_doc({ item = frappe.get_doc({
'doctype': 'Item', 'doctype': 'Item',
@@ -92,7 +94,7 @@ def create_item_from_template(doc):
'show_in_website': 0, 'show_in_website': 0,
'is_pro_applicable': 0, 'is_pro_applicable': 0,
'disabled': disabled, 'disabled': disabled,
'stock_uom': 'Unit' 'stock_uom': uom
}).insert(ignore_permissions=True) }).insert(ignore_permissions=True)
#insert item price #insert item price