Esempio n. 1
0
    def testSearch(self):
        branches = self.store.find(Branch)

        product = self.create_product()
        storable = self.create_storable(product=product)
        ProductStockItem(quantity=1, branch=branches[0], storable=storable,
                         store=self.store)
        ProductStockItem(quantity=2, branch=branches[1], storable=storable,
                         store=self.store)
        product.sellable.code = u'65432'
        product.sellable.description = u'Camiseta'
        product.sellable.status = Sellable.STATUS_AVAILABLE
        self.create_product_component(product=product)

        product = self.create_product()
        storable = self.create_storable(product=product)
        ProductStockItem(quantity=3, branch=branches[0], storable=storable,
                         store=self.store)
        ProductStockItem(quantity=4, branch=branches[1], storable=storable,
                         store=self.store)
        product.sellable.code = u'54321'
        product.sellable.description = u'Luva'
        product.sellable.status = Sellable.STATUS_UNAVAILABLE
        self.create_product_component(product=product)

        search = ProductionProductSearch(self.store)

        search.search.refresh()
        self.check_search(search, 'production-product-no-filter')

        search.set_searchbar_search_string('luv')
        search.search.refresh()
        self.check_search(search, 'production-product-string-filter')

        search.set_searchbar_search_string('')
        search.branch_filter.set_state(2)
        search.search.refresh()
        self.check_search(search, 'production-product-branch-filter')

        search.branch_filter.set_state(None)
        search.status_filter.set_state(Sellable.STATUS_AVAILABLE)
        search.search.refresh()
        self.check_search(search, 'production-product-status-filter')
    def test_search(self):
        branches = self.store.find(Branch)

        product = self.create_product()
        storable = self.create_storable(product=product)
        self.create_product_stock_item(
            storable=storable, branch=branches[0], quantity=1)
        self.create_product_stock_item(
            storable=storable, branch=branches[1], quantity=2)
        product.sellable.code = u'65432'
        product.sellable.description = u'Camiseta'
        product.is_composed = True
        self.create_product_component(product=product)

        product = self.create_product()
        storable = self.create_storable(product=product)
        self.create_product_stock_item(
            storable=storable, branch=branches[0], quantity=3)
        self.create_product_stock_item(
            storable=storable, branch=branches[1], quantity=4)
        product.sellable.code = u'54321'
        product.sellable.description = u'Luva'
        product.sellable.status = Sellable.STATUS_CLOSED
        self.create_product_component(product=product)

        search = ProductionProductSearch(self.store)

        search.search.refresh()
        self.check_search(search, 'production-product-no-filter')

        search.set_searchbar_search_string('luv')
        search.search.refresh()
        self.check_search(search, 'production-product-string-filter')

        search.set_searchbar_search_string('')
        search.branch_filter.set_state(api.get_current_branch(self.store).id)
        search.search.refresh()
        self.check_search(search, 'production-product-branch-filter')

        search.branch_filter.set_state(None)
        search.status_filter.set_state(Sellable.STATUS_AVAILABLE)
        search.search.refresh()
        self.check_search(search, 'production-product-status-filter')
Esempio n. 3
0
    def test_search(self):
        branches = self.store.find(Branch)

        product = self.create_product()
        storable = self.create_storable(product=product)
        ProductStockItem(quantity=1, branch=branches[0], storable=storable, store=self.store)
        ProductStockItem(quantity=2, branch=branches[1], storable=storable, store=self.store)
        product.sellable.code = u"65432"
        product.sellable.description = u"Camiseta"
        product.is_composed = True
        self.create_product_component(product=product)

        product = self.create_product()
        storable = self.create_storable(product=product)
        ProductStockItem(quantity=3, branch=branches[0], storable=storable, store=self.store)
        ProductStockItem(quantity=4, branch=branches[1], storable=storable, store=self.store)
        product.sellable.code = u"54321"
        product.sellable.description = u"Luva"
        product.sellable.status = Sellable.STATUS_CLOSED
        self.create_product_component(product=product)

        search = ProductionProductSearch(self.store)

        search.search.refresh()
        self.check_search(search, "production-product-no-filter")

        search.set_searchbar_search_string("luv")
        search.search.refresh()
        self.check_search(search, "production-product-string-filter")

        search.set_searchbar_search_string("")
        search.branch_filter.set_state(api.get_current_branch(self.store).id)
        search.search.refresh()
        self.check_search(search, "production-product-branch-filter")

        search.branch_filter.set_state(None)
        search.status_filter.set_state(Sellable.STATUS_AVAILABLE)
        search.search.refresh()
        self.check_search(search, "production-product-status-filter")
Esempio n. 4
0
    def test_search(self):
        branches = self.store.find(Branch)

        product = self.create_product()
        storable = self.create_storable(product=product)
        ProductStockItem(quantity=1,
                         branch=branches[0],
                         storable=storable,
                         store=self.store)
        ProductStockItem(quantity=2,
                         branch=branches[1],
                         storable=storable,
                         store=self.store)
        product.sellable.code = u'65432'
        product.sellable.description = u'Camiseta'
        self.create_product_component(product=product)

        product = self.create_product()
        storable = self.create_storable(product=product)
        ProductStockItem(quantity=3,
                         branch=branches[0],
                         storable=storable,
                         store=self.store)
        ProductStockItem(quantity=4,
                         branch=branches[1],
                         storable=storable,
                         store=self.store)
        product.sellable.code = u'54321'
        product.sellable.description = u'Luva'
        product.sellable.status = Sellable.STATUS_CLOSED
        self.create_product_component(product=product)

        search = ProductionProductSearch(self.store)

        search.search.refresh()
        self.check_search(search, 'production-product-no-filter')

        search.set_searchbar_search_string('luv')
        search.search.refresh()
        self.check_search(search, 'production-product-string-filter')

        search.set_searchbar_search_string('')
        search.branch_filter.set_state(api.get_current_branch(self.store).id)
        search.search.refresh()
        self.check_search(search, 'production-product-branch-filter')

        search.branch_filter.set_state(None)
        search.status_filter.set_state(Sellable.STATUS_AVAILABLE)
        search.search.refresh()
        self.check_search(search, 'production-product-status-filter')