def Clicked(self, item): self.addbtn.setEnabled(True) code = before(item.text(), '-') if select_spare_parts_bycode(code): rawMat = select_spare_parts_bycode(code) self.spnameled.setText(rawMat.name) self.spcodeled.setText(rawMat.code) self.spinqtyled.setText(str(rawMat.inv_qty)) self.spgencodeled.setText(rawMat.gen_code) return rawMat
def do_delete(self): code = self.codeled.text() if select_spare_parts_bycode(code): rawMat = select_spare_parts_bycode(code) reply = QMessageBox.question(QMessageBox(), "OOP'S", 'Are you sure to delete ?\n Spare Part \n Code : {}'.format( rawMat.code) + '\n System Code : {}'.format( rawMat.gen_code) + '\n Name : {}'.format( rawMat.name) + '\n This Action Cant Undo', QMessageBox.Yes | QMessageBox.No) if reply == QMessageBox.Yes: delete_spare_parts(rawMat.id)
def do_add(self): code = self.spgencodeled.text() spare = select_spare_parts_bycode(code) qty = self.reqqtyled_2.text() if not qty == '': self.close() createNewBOMItem(self.bomObj.id, None, spare.id, int(qty)) else: self.statulbl.setText("You must enter quantity you want")
def do_add(self): datetimestr = datetime.now() timestampstr = datetimestr.strftime('%Y-%m-%d %H:%M:%S') code = self.spgencodeled.text() rawmat = select_spare_parts_bycode(code) qty = self.reqqtyled_2.text() reas = self.resonled.text() if qty != '' or reas != '': if type(self.obj) == Employees: add_outbound(OutBCode(), timestampstr, reas, None, self.obj.id, None , rawmat.id, None, None, qty, 1) if type(self.obj) == Customers: add_outbound(OutBCode(), timestampstr, reas, self.obj.id, None, None , rawmat.id, None, None, qty, 1) decreaseSparePartsInvQty(rawmat, int(qty)) self.close()