Exemplo n.º 1
0
 def add_operation(self):
     ''' add operation '''
     unite_ = self.liste_unite[self.box_unite.currentIndex()]
     if unicode(self.libelle.text()) != "":
         if unicode(unite_) != "":
             produit = Produit()
             produit.libelle = unicode(self.libelle.text())
             produit.unite = unicode(unite_)
             produit.save()
             self.libelle.clear()
             self.table_op.refresh_()
             raise_success(_(u"Confirmation"), _(u"The product %s "
                           u" was recorded") % produit.libelle)
         else:
             raise_error(_(u"error"), \
                         _(u"Give the room number in the box"))
     else:
         raise_error(_(u"Error"), _(u"Give the name of the product"))