From c5a4e423c64e9fdc1f00a56dbecb39dab9051ab3 Mon Sep 17 00:00:00 2001 From: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> Date: Wed, 5 Jun 2019 20:23:41 +0530 Subject: [PATCH] fix: NoneType fixes in Lab test (#17856) --- erpnext/healthcare/doctype/lab_test/lab_test.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/erpnext/healthcare/doctype/lab_test/lab_test.py b/erpnext/healthcare/doctype/lab_test/lab_test.py index b0bd4c6a680..86094896154 100644 --- a/erpnext/healthcare/doctype/lab_test/lab_test.py +++ b/erpnext/healthcare/doctype/lab_test/lab_test.py @@ -300,11 +300,15 @@ def insert_lab_test_to_medical_record(doc): elif doc.special_test_items: item = doc.special_test_items[0] - table_row = item.lab_test_particulars +" "+ item.result_value + + if item.lab_test_particulars and item.result_value: + table_row = item.lab_test_particulars +" "+ item.result_value elif doc.sensitivity_test_items: item = doc.sensitivity_test_items[0] - table_row = item.antibiotic +" "+ item.antibiotic_sensitivity + + if item.antibiotic and item.antibiotic_sensitivity: + table_row = item.antibiotic +" "+ item.antibiotic_sensitivity if table_row: subject += "
"+table_row