fix: msgprint for sample collection doc created on Lab Test creation

This commit is contained in:
Rucha Mahabal 2020-07-30 14:50:30 +05:30
parent c33703d54c
commit 73edb12ab3
2 changed files with 14 additions and 7 deletions

View File

@ -6,7 +6,7 @@ from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import getdate, cstr
from frappe.utils import getdate, cstr, get_link_to_form
class LabTest(Document):
def validate(self):
@ -262,7 +262,9 @@ def create_sample_collection(lab_test, template, patient, invoice):
sample_collection = create_sample_doc(template, patient, invoice, lab_test.company)
if sample_collection:
lab_test.sample = sample_collection.name
sample_collection_doc = get_link_to_form('Sample Collection', sample_collection.name)
frappe.msgprint(_('Sample Collection {0} has been created').format(sample_collection_doc),
title=_('Sample Collection'), indicator='green')
return lab_test
def load_result_format(lab_test, template, prescription, invoice):

View File

@ -34,14 +34,15 @@
"descriptive_test_templates",
"section_break_group",
"lab_test_groups",
"medical_coding_section",
"medical_code_standard",
"medical_code",
"sb_sample_collection",
"sample",
"sample_uom",
"sample_qty",
"column_break_33",
"sample_details",
"medical_coding_section",
"medical_code",
"medical_code_standard",
"worksheet_section",
"worksheet_instructions",
"result_legend_section",
@ -128,6 +129,7 @@
"mandatory_depends_on": "eval:doc.is_billable == 1"
},
{
"collapsible": 1,
"fieldname": "medical_coding_section",
"fieldtype": "Section Break",
"label": "Medical Coding"
@ -217,7 +219,6 @@
"no_copy": 1
},
{
"collapsible": 1,
"fieldname": "sb_sample_collection",
"fieldtype": "Section Break",
"label": "Sample Collection"
@ -311,10 +312,14 @@
"fieldname": "descriptive_test_templates",
"fieldtype": "Table",
"options": "Descriptive Test Template"
},
{
"fieldname": "column_break_33",
"fieldtype": "Column Break"
}
],
"links": [],
"modified": "2020-07-30 11:55:43.093828",
"modified": "2020-07-30 14:32:40.449818",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Lab Test Template",