def create_test_results(test_detail): d = Document("Test Results") d.sample_no = test_detail.get("sample_no") d.test_name = test_detail.get("test") d.test_id= test_detail.get("name") if test_detail.get("temperature"): d.temperature=test_detail.get("temperature") d.save() return d.name
def create_doc(self, test_name, sample): test_method, specification = self.get_test_method(sample) test = Document(test_name) test.sample_no = sample.get("sample_no") test.specification = specification test.temperature = get_temp(sample.get("sample_no")) test.tested_by = self.doc.tester test.save() self.update_test_id(sample,test.name) return test.name
def generate_sample(sample): from webnotes.model.doc import Document d = Document('Sample') d.sample_entry = sample['name'] d.barcode = webnotes.conn.get_value("Sample Entry", sample['name'], 'bottle_list') d.client_name = webnotes.conn.get_value('Sample Entry', sample['name'], 'client_name') d.temperature = webnotes.conn.get_value('Sample Entry', sample['name'], 'testing_temperature') d.save() update_sample_entry(sample['name']) update_sample(sample, d.name)
def create_child_test_preparation(self, samples, test_name, parent): temp = 0 childtab = {'Neutralization Value':['neutralisation_test_details', 'Neutralization Test Details']} from webnotes.model.doc import get if parent and samples: doc = get('Neutralization Value' if test_name=='Neutralization Value' else 'Test Preparation', parent) doclist = get('Neutralization Value' if test_name=='Neutralization Value' else 'Test Preparation', parent, with_children=1) for sample in samples: ch = addchild(doc[0], childtab.get(test_name)[0] if childtab.get(test_name) else 'sample_details', childtab.get(test_name)[1] if childtab.get(test_name) else 'Sample Preparation Details', doclist) ch.sample_no = sample ch.bottle_no= webnotes.conn.get_value("Sample", sample, "barcode") if test_name != 'Neutralization Value': ch.tester=self.doc.tester ch.save() temp = get_temp(sample) d = Document('Neutralization Value' if test_name=='Neutralization Value' else 'Test Preparation', parent) d.temperature = temp d.save()