From bd7ba829bb9c62edafbd592785ce098a43eaf7db Mon Sep 17 00:00:00 2001 From: Sajin SR Date: Fri, 20 Dec 2024 18:44:12 +0530 Subject: [PATCH] fix(Sample Collection): set sales invoice reference conditionally --- .../healthcare/doctype/sample_collection/sample_collection.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/healthcare/healthcare/doctype/sample_collection/sample_collection.py b/healthcare/healthcare/doctype/sample_collection/sample_collection.py index 5d9fdf25b0..9efadf848a 100644 --- a/healthcare/healthcare/doctype/sample_collection/sample_collection.py +++ b/healthcare/healthcare/doctype/sample_collection/sample_collection.py @@ -116,7 +116,9 @@ def insert_observation(selected, sample_collection, component_observations=None, specimen=comp_obs_ref.get(obs.get("name")) or comp_obs_ref.get(i + 1) or comp_obs_ref.get(obs.get("idx")), - invoice=sample_col_doc.get("reference_name"), + invoice=sample_col_doc.get("reference_name") + if sample_col_doc.reference_doc == "Sales Invoice" + else None, practitioner=sample_col_doc.get("referring_practitioner"), child=obs.get("reference_child") if obs.get("reference_child") else "", service_request=obs.get("service_request"),