Beispiel #1
0
 def setRow(self,row):
     """Заполнение списка блюд"""
     #widget = productDishPanel_Class(self, (row['id'], row['name']))
     try:
         widget = productDishPanel_Class(self, (row['id'], row['name']))
         self.productWidget[row['id']] = widget
         self.groupWidget[int(row['section'])].insertChild(0,self.productWidget[row['id']])
     except:
         None
Beispiel #2
0
    def setRow(self, row):
        """Заполнение списка блюд"""
        # widget = productDishPanel_Class(self, (row['id'], row['name']))

        # try:
        # ~ print (row['id'], row['name'])
        widget = productDishPanel_Class(self, (row["id"], row["name"]))
        self.productWidget[row["id"]] = widget
        self.groupWidget[int(row["section"])].insertChild(0, self.productWidget[row["id"]])
Beispiel #3
0
 def delFromMenu(self):
     """Удаляет из меню"""
     item = self.ui.treeWidgetMenu.currentItem()
     portions = item.portions
     item.removePortions(portions)
     for product in item.consumption:
         self.products[product] += item.consumption[product] * portions
     if item.did in self.productWidget:
         item.changeCount()
         self.productWidget[item.did].portions += portions
         self.productWidget[item.did].setText(1, u"%s" % self.productWidget[item.did].portions)
     else:
         widget = productDishPanel_Class(self, (item.did, item.name, portions))
         # widget.portions = portions
         widget.max_amortization = item.max_amortization
         # widget.price = widget.getDishPrice()
         item.setText(1, u"%s" % item.portions)
         widget.setText(1, u"%s" % widget.portions)
         self.productWidget[item.did] = widget
         self.ui.treeWidgetDish.addTopLevelItem(self.productWidget[item.did])
     self.ui.treeWidgetMenu.takeTopLevelItem(self.ui.treeWidgetMenu.indexOfTopLevelItem(item))
     del self.menuWidget[item.did]
     self.renewPortions()