def create_test(self, sample): test = Document(sample.get("test")) test.sample_no = sample.get("sample_no") # test.tested_by = sample.get("tester") test.shift_incharge_approval = sample.get("shift_incharge") test.lab_incharge_approval = sample.get("lab_incharge") test.save() self.update_test_id(sample,test.name) return test.name
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_test_doc(self, sample, test_name): #webnotes.errprint("create test document") test=Document(test_name) test.sample_no=sample.sample_no if test_name == "Test Of Extract": test.total_weight_of_oil = self.doc.total_weight_of_oil test.tested_by=sample.tester test.save() #webnotes.errprint(test) return {test_name: test.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 update_test_log(test_details): #webnotes.errprint(emp) d = Document('Test Log') d.sample_no = test_details.get("sample_no") d.test = test_details.get("test") d.status = test_details.get("workflow_state") #webnotes.errprint(d.status) d.tester=test_details.get("tested_by") d.shift_incharge=test_details.get("shift_incharge") d.lab_incharge=test_details.get("lab_incharge") d.save()
def create_child_test_document(self, samples, parent, test_name, child_details): for sample in samples: ch = Document(child_details.get('child_mapper')) ch.sample_no = sample[0] ch.parent = parent if test_name == "Test Preparation": ch.tester = sample[1] ch.specification = sample[2] ch.save()
def create_parent(self, sample_dict): d = Document('Test Allocation') d.sample_no = sample_dict['sample_no'] d.bottle_no = sample_dict['bottle_no'] d.priority = sample_dict['priority'] d.specification = sample_dict['specification'] d.group_name = sample_dict['test_group'] d.docstatus = 1 d.save() self.update_sample_master(sample_dict) return d.name