Esempio n. 1
0
    def get_extra_tabs(self):
        from stoqlib.gui.slaves.productslave import (ProductTaxSlave,
                                                     ProductSupplierSlave,
                                                     ProductGridSlave)
        extra_tabs = []

        suppliers_slave = ProductSupplierSlave(self.store, self.model,
                                               self.visual_mode)
        extra_tabs.append((_(u'Suppliers'), suppliers_slave))

        tax_slave = ProductTaxSlave(self.store, self.model, self.visual_mode)
        extra_tabs.append((_(u'Taxes'), tax_slave))

        if self.model.product_type == Product.TYPE_GRID:
            # If there is a wizard, it means we are creating a new product.
            # Store the selected attributes in the database
            if self._wizard:
                for attribute in self._wizard.attr_list:
                    ProductAttribute(store=self.store,
                                     product_id=self.model.id,
                                     attribute_id=attribute.id)

            attribute_option_slave = ProductGridSlave(self.store, self.model,
                                                      self.visual_mode)
            extra_tabs.append((_(u'Grid'), attribute_option_slave))
            attribute_option_slave.grid_tab_alignment.connect(
                'focus', self._on_grid_tab_alignment__focus)

        return extra_tabs
Esempio n. 2
0
    def get_extra_tabs(self):
        from stoqlib.gui.slaves.productslave import (ProductTaxSlave,
                                                     ProductSupplierSlave)
        extra_tabs = []

        suppliers_slave = ProductSupplierSlave(self.store, self.model,
                                               self.visual_mode)
        extra_tabs.append((_(u'Suppliers'), suppliers_slave))

        tax_slave = ProductTaxSlave(self.store, self.model, self.visual_mode)
        extra_tabs.append((_(u'Taxes'), tax_slave))
        return extra_tabs
Esempio n. 3
0
 def get_extra_tabs(self):
     from stoqlib.gui.slaves.productslave import (ProductTaxSlave,
                                                  ProductComponentSlave,
                                                  ProductQualityTestSlave)
     self.component_slave = ProductComponentSlave(self.store, self.model,
                                                  self.visual_mode)
     tax_slave = ProductTaxSlave(self.store, self.model, self.visual_mode)
     quality_slave = ProductQualityTestSlave(self, self.store, self.model,
                                             self.visual_mode)
     return [
         (_(u'Components'), self.component_slave),
         (_(u'Taxes'), tax_slave),
         (_(u'Quality'), quality_slave),
     ]