def create_document_level0(self): #webnotes.errprint("in document") c=Document('Employee Training Details') c.test= 'Level 0 Completed' c.is_pass= 1 c.level= self.doc.training_level c.parent=self.doc.employee c.save()
def on_submit(self): if self.doc.training_status=='Completed' or self.doc.training_status==None: tests=webnotes.conn.sql("select test from `tabTraining Details` where is_pass='******' and parent='"+self.doc.name+"' ") #webnotes.errprint(tests) if tests: for j in tests: #webnotes.errprint(j[0]) d=Document('Employee Training Details') d.test= j[0] d.is_pass= 1 d.level= self.doc.training_level d.parent=self.doc.employee d.save() self.create_email(); self.assign_to(); #For Level 0 if self.doc.training_level=='Level 0': self.create_document_level0(); else: webnotes.msgprint("For successful completion of form update Training Status to 'Completed' ",raise_exception=1)