search Package

search Package

callsearch Module

class stoqlib.gui.search.callsearch.CallsSearch(store, person=None, date=None, reuse_store=False)[source]

Bases: stoqlib.gui.search.searcheditor.SearchEditor

This search can be used directly, to show calls to any kind of person in the system.

Subclasses can also override I{person_type} to set the person type that will be available when creating a new call, and I{person_name}, that will be the column title in this search.

title = 'Calls Search'
search_spec

alias of CallsView

editor_class

alias of CallsEditor

person_type = None
person_name = 'Person'
size = (700, 450)
get_editor_model(calls)[source]
setup_widgets()[source]
create_filters()[source]
get_columns()[source]
executer_query(store)[source]
update_widgets(*args)[source]
run_editor(obj)[source]
class stoqlib.gui.search.callsearch.ClientCallsSearch(store, person=None, date=None, reuse_store=False)[source]

Bases: stoqlib.gui.search.callsearch.CallsSearch

title = 'Calls Search'
search_spec

alias of ClientCallsView

person_type

alias of Client

person_name = 'Client'

categorysearch Module

A dialog for sellable categories selection, offering buttons for creation and edition.

class stoqlib.gui.search.categorysearch.SellableCategorySearch(store, editor_class=None, interface=None, search_spec=None, hide_footer=True, title='', selection_mode=None, hide_toolbar=False, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searcheditor.SearchEditor

size = (750, 500)
title = 'Sellable Category Search'
search_label = 'Categories Matching:'
search_spec

alias of SellableCategoryView

tree = True
editor_class

alias of SellableCategoryEditor

create_filters()[source]
get_columns()[source]
get_editor_model(commission_source_category_view)[source]

Search Editor hook

run_dialog(*args, **kwargs)[source]

creditcheckhistorysearch Module

class stoqlib.gui.search.creditcheckhistorysearch.CreditCheckHistorySearch(store, client=None, reuse_store=False)[source]

Bases: stoqlib.gui.search.searcheditor.SearchEditor

A search dialog for querying the credit history for a client

title = 'Client Credit Check History Search'
editor_class

alias of CreditCheckHistoryEditor

search_spec

alias of CreditCheckHistoryView

size = (700, 450)
get_editor_model(credit_check_history)[source]
create_filters()[source]
get_columns()[source]
executer_query(store)[source]
update_widgets(*args)[source]
run_editor(obj)[source]

clientsalaryhistorysearch Module

class stoqlib.gui.search.clientsalaryhistorysearch.ClientSalaryHistorySearch(store, client=None)[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

This search can be used directly, to show all the salaries that have been registered to a client

title = 'Salary History Search'
search_spec

alias of ClientSalaryHistoryView

size = (600, 450)
create_filters()[source]
get_columns()[source]
executer_query(store)[source]

commissionsearch Module

Search dialogs for commission objects

class stoqlib.gui.search.commissionsearch.CommissionSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = 'Search for Commissions'
size = (800, 450)
search_spec

alias of CommissionView

report_class

alias of SalesPersonReport

unlimited_results = True
setup_widgets()[source]
create_filters()[source]
get_columns()[source]
print_report()[source]
on_search__search_completed(search, result_view, states)[source]

consignmentsearch Module

Search dialogs for consignment and related objects

class stoqlib.gui.search.consignmentsearch.ConsignmentItemSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = u'Consignment Items Search'
size = (-1, 450)
search_spec

alias of ConsignedItemAndStockView

branch_filter_column

alias of Branch

text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb42911a0>, <storm.expr.Cast object at 0x7f2caff5d210>]
get_columns()[source]

costcentersearch Module

Search class for cost center objects

class stoqlib.gui.search.costcentersearch.CostCenterSearch(store, editor_class=None, interface=None, search_spec=None, hide_footer=True, title='', selection_mode=None, hide_toolbar=False, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searcheditor.SearchEditor

title = 'Search for cost centers'
size = (-1, 300)
search_spec

alias of CostCenter

editor_class

alias of CostCenterEditor

create_filters()[source]
get_columns()[source]
on_details_button_clicked(*args)[source]
row_activate(obj)[source]
stoqlib.gui.search.costcentersearch.test()[source]

deliverysearch Module

Search dialogs for stoqlib.domain.sale.Delivery objects

class stoqlib.gui.search.deliverysearch.DeliverySearch(store, editor_class=None, interface=None, search_spec=None, hide_footer=True, title='', selection_mode=None, hide_toolbar=False, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searcheditor.SearchEditor

Delivery search implementation

title = 'Delivery Search'
search_spec

alias of DeliveryView

editor_class

alias of DeliveryEditor

has_new_button = False
size = (750, 450)
create_filters()[source]
get_editor_model(viewable)[source]
get_columns()[source]

eventsearch Module

Implementation of event search

class stoqlib.gui.search.eventsearch.EventSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = 'Search for events'
size = (750, 500)
search_spec

alias of Event

fast_iter = True
create_filters()[source]
executer_query(store)[source]
get_columns()[source]

Hook called by SearchEditor

fiscalsearch Module

Search dialogs for fiscal objects

class stoqlib.gui.search.fiscalsearch.FiscalBookEntryType[source]

Bases: kiwi.python.enum

ICMS = <FiscalBookEntryType value ICMS>
IPI = <FiscalBookEntryType value IPI>
ISS = <FiscalBookEntryType value ISS>
names = {'ICMS': <FiscalBookEntryType value ICMS>, 'ISS': <FiscalBookEntryType value ISS>, 'IPI': <FiscalBookEntryType value IPI>}
values = {0: <FiscalBookEntryType value ICMS>, 1: <FiscalBookEntryType value IPI>, 2: <FiscalBookEntryType value ISS>}
class stoqlib.gui.search.fiscalsearch.CfopSearch(store, editor_class=None, interface=None, search_spec=None, hide_footer=True, title='', selection_mode=None, hide_toolbar=False, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searcheditor.SearchEditor

title = 'C.F.O.P. Search'
search_spec

alias of CfopData

editor_class

alias of CfopEditor

size = (-1, 390)
create_filters()[source]
get_columns()[source]
class stoqlib.gui.search.fiscalsearch.FiscalBookEntrySearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = 'Search for fiscal entries'
size = (-1, 450)
search_spec

alias of IcmsIpiView

text_field_columns = []
branch_filter_column

column: PropertyColumn

get_columns()[source]
setup_widgets()[source]
update_widgets()[source]
create_filters()[source]

gridsearch Module

Search dialogs for grid configuration implementation

class stoqlib.gui.search.gridsearch.GridGroupSearch(store, editor_class=None, interface=None, search_spec=None, hide_footer=True, title='', selection_mode=None, hide_toolbar=False, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searcheditor.SearchEditor

title = 'Grid Group Search'
search_spec

alias of GridGroup

text_field_columns = ['description']
editor_class

alias of GridGroupEditor

size = (-1, 390)
search_label = 'Attribute Group Matching:'
get_columns()[source]
class stoqlib.gui.search.gridsearch.GridAttributeSearch(store, editor_class=None, interface=None, search_spec=None, hide_footer=True, title='', selection_mode=None, hide_toolbar=False, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searcheditor.SearchEditor

title = 'Grid Attribute Search'
search_spec

alias of GridAttribute

text_field_columns = ['description']
editor_class

alias of GridAttributeEditor

size = (-1, 390)
search_label = 'Attribute Matching:'
get_columns()[source]

loansearch Module

Search dialogs for loans and related objects

class stoqlib.gui.search.loansearch.LoanItemSearch(store, hide_footer=True, hide_toolbar=True)[source]

Bases: stoqlib.gui.search.productsearch.ProductSearch

title = u'Loan Items Search'
search_spec

alias of LoanItemView

has_print_price_button = False
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb42911a0>, <storm.expr.Cast object at 0x7f2caff75650>]
create_filters()[source]
get_columns()[source]
class stoqlib.gui.search.loansearch.LoanSearch(store)[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = u'Loan Search'
size = (750, 500)
search_spec

alias of LoanView

report_class

alias of LoanReceipt

selection_mode = <enum GTK_SELECTION_MULTIPLE of type GtkSelectionMode>
update_widgets()[source]
create_filters()[source]
get_columns()[source]
print_report()[source]
on_row_activated(klist, item_view)[source]
on_details_button_clicked(button)[source]

parametersearch Module

Listing dialog for system parameters

class stoqlib.gui.search.parametersearch.ParameterSearch(store)[source]

Bases: stoqlib.gui.editors.baseeditor.BaseEditor

gladefile = 'ParameterSearch'
model_type

alias of object

size = (750, 450)
title = u'Stoq System Parameters'
on_results__selection_changed(list, data)[source]
on_edit_button__clicked(widget)[source]
on_results__double_click(list, data)[source]
on_results__row_activated(list, data)[source]
on_entry__activate(widget)[source]
on_show_all_button__clicked(widget)[source]
on_search_button__clicked(widget)[source]

paymentsearch Module

Search dialogs for payment objects

class stoqlib.gui.search.paymentsearch.InPaymentBillCheckSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.paymentsearch._BaseBillCheckSearch

search_spec

alias of InCheckPaymentView

text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb4ed2bb0>, <storm.properties.PropertyColumn object at 0x7f2cb4ebb3d0>]
class stoqlib.gui.search.paymentsearch.OutPaymentBillCheckSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.paymentsearch._BaseBillCheckSearch

search_spec

alias of OutCheckPaymentView

text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb4ed2bb0>, <storm.properties.PropertyColumn object at 0x7f2cb4ebb3d0>]
get_columns()[source]
class stoqlib.gui.search.paymentsearch.CardPaymentSearch(store)[source]

Bases: stoqlib.gui.search.searcheditor.SearchEditor

title = u'Card Payment Search'
size = (850, 500)
search_spec

alias of CardPaymentView

editor_class

alias of CardPaymentDetailsEditor

report_class

alias of CardPaymentReport

search_label = u'Client:'
selection_mode = <enum GTK_SELECTION_BROWSE of type GtkSelectionMode>
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cafebe980>, <storm.expr.Cast object at 0x7f2cafed0110>]
branch_filter_column

column: PropertyColumn

create_filters()[source]
get_editor_model(payment_card_view)[source]
get_columns()[source]
row_activate(obj)[source]
on_results__selection_changed(results, selected)[source]
on_details_button_clicked(button)[source]

paymentreceivingsearch Module

class stoqlib.gui.search.paymentreceivingsearch.PaymentReceivingSearch(store)[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = 'Payments to Receive Search'
size = (775, 450)
search_spec

alias of InPaymentView

create_filters()[source]
get_columns()[source]
executer_query(store)[source]
on_receive_button_clicked(button)[source]

personsearch Module

Search dialogs for person objects

class stoqlib.gui.search.personsearch.BasePersonSearch(store, title='', hide_footer=True)[source]

Bases: stoqlib.gui.search.searcheditor.SearchEditor

size = (-1, 500)
search_spec = None
interface = None
editor_class = None
title = 'Person Search'
run_dialog(editor_class, parent, *args, **kwargs)[source]
class stoqlib.gui.search.personsearch.EmployeeSearch(store, title='', hide_footer=True)[source]

Bases: stoqlib.gui.search.personsearch.BasePersonSearch

title = 'Employee Search'
editor_class

alias of EmployeeEditor

search_spec

alias of EmployeeView

text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb4e9d3d0>, <storm.properties.PropertyColumn object at 0x7f2cb4e66fa0>, <storm.properties.PropertyColumn object at 0x7f2cb4e37c90>]
create_filters()[source]
get_columns()[source]
get_editor_model(model)[source]
class stoqlib.gui.search.personsearch.SupplierSearch(store, **kwargs)[source]

Bases: stoqlib.gui.search.personsearch.BasePersonSearch

title = 'Supplier Search'
editor_class

alias of SupplierEditor

size = (800, 450)
search_spec

alias of SupplierView

search_label = 'Suppliers Matching:'
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb4e9d3d0>, <storm.properties.PropertyColumn object at 0x7f2cb4e9d4b0>, <storm.properties.PropertyColumn object at 0x7f2cb4e9dd00>]
get_columns()[source]
on_details_button_clicked(*args)[source]
update_widgets(*args)[source]
get_editor_model(supplier_view)[source]
class stoqlib.gui.search.personsearch.ClientSearch(store, birth_date=None, **kwargs)[source]

Bases: stoqlib.gui.search.personsearch.BasePersonSearch

title = 'Client Search'
editor_class

alias of ClientEditor

search_spec

alias of ClientView

search_label = 'matching:'
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb4e9d3d0>, <storm.properties.PropertyColumn object at 0x7f2cb4e9d670>, <storm.properties.PropertyColumn object at 0x7f2cb4e9db40>, <storm.properties.PropertyColumn object at 0x7f2cb4e9d4b0>, <storm.properties.PropertyColumn object at 0x7f2cb4e9d360>, <storm.properties.PropertyColumn object at 0x7f2cb4e9dd70>, <storm.properties.PropertyColumn object at 0x7f2cb4e9d1a0>]
setup_widgets()[source]
create_filters()[source]
get_columns()[source]
get_editor_model(client_view)[source]
on_details_button_clicked(*args)[source]
update_widgets(*args)[source]
class stoqlib.gui.search.personsearch.TransporterSearch(store, title='', hide_footer=True)[source]

Bases: stoqlib.gui.search.personsearch.BasePersonSearch

title = 'Transporter Search'
editor_class

alias of TransporterEditor

search_spec

alias of TransporterView

search_label = 'matching:'
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb4e9d3d0>, <storm.properties.PropertyColumn object at 0x7f2cb4e9d4b0>]
create_filters()[source]
get_columns()[source]
get_editor_model(model)[source]
class stoqlib.gui.search.personsearch.EmployeeRoleSearch(store, editor_class=None, interface=None, search_spec=None, hide_footer=True, title='', selection_mode=None, hide_toolbar=False, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searcheditor.SearchEditor

title = 'Employee Role Search'
editor_class

alias of EmployeeRoleEditor

search_spec

alias of EmployeeRole

search_label = 'Role Matching'
size = (-1, 390)
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb4e66fa0>]
get_columns()[source]
class stoqlib.gui.search.personsearch.BranchSearch(store, title='', hide_footer=True)[source]

Bases: stoqlib.gui.search.personsearch.BasePersonSearch

title = 'Branch Search'
editor_class

alias of BranchEditor

search_spec

alias of BranchView

search_label = 'matching'
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb4e9d3d0>, <storm.properties.PropertyColumn object at 0x7f2cb4e542f0>, <storm.properties.PropertyColumn object at 0x7f2cb4e9d4b0>]
create_filters()[source]
get_columns()[source]
get_editor_model(branch_view)[source]
class stoqlib.gui.search.personsearch.UserSearch(store, title='', hide_footer=True)[source]

Bases: stoqlib.gui.search.personsearch.BasePersonSearch

title = 'User Search'
editor_class

alias of UserEditor

size = (750, 450)
search_spec

alias of UserView

search_label = 'Users Matching:'
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb4e9d3d0>, <storm.properties.PropertyColumn object at 0x7f2cb4e66e50>, <storm.properties.PropertyColumn object at 0x7f2cb4e54280>]
get_columns()[source]
on_details_button_clicked(*args)[source]
update_widgets(*args)[source]
get_editor_model(user_view)[source]
class stoqlib.gui.search.personsearch.ClientsWithSaleSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = u'Clients with Sale'
search_spec

alias of ClientsWithSaleView

report_class

alias of ClientsWithSaleReport

size = (800, 450)
unlimited_results = True
branch_filter_column

column: PropertyColumn

text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb4e9d3d0>, <storm.properties.PropertyColumn object at 0x7f2cb4e9d4b0>, <storm.properties.PropertyColumn object at 0x7f2cb4e37130>]
setup_widgets()[source]
create_filters()[source]
get_columns(*args)[source]
update_widgets()[source]
on_details_button_clicked(*args)[source]
class stoqlib.gui.search.personsearch.ClientsWithCreditSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = u'Clients with Credit'
search_spec

alias of ClientsWithCreditView

size = (800, 450)
fast_iter = True
unlimited_results = True
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb4e9d3d0>]
setup_widgets()[source]
get_columns(*args)[source]
update_widgets()[source]
on_details_button_clicked(*args)[source]

productionsearch Module

Search dialogs for production objects

class stoqlib.gui.search.productionsearch.ProductionProductSearch(store, hide_footer=True, hide_toolbar=False, hide_cost_column=False, hide_price_column=False, double_click_confirm=False)[source]

Bases: stoqlib.gui.search.productsearch.ProductSearch

title = u'Production Product'
search_spec

alias of ProductComponentWithClosedView

editor_class

alias of ProductionProductEditor

get_editor_class_for_object(obj)[source]
executer_query(store)[source]
get_editor_model(product_component)[source]
class stoqlib.gui.search.productionsearch.ProductionItemsSearch(store, hide_footer=True, hide_toolbar=True)[source]

Bases: stoqlib.gui.search.productsearch.ProductSearch

title = u'Production Items'
search_spec

alias of ProductionItemView

report_class

alias of ProductionItemReport

csv_data = None
has_print_price_button = False
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb42911a0>, <storm.expr.Cast object at 0x7f2caff6c050>]
create_filters()[source]
get_columns()[source]
class stoqlib.gui.search.productionsearch.ProductionHistorySearch(store, hide_footer=True, hide_toolbar=True)[source]

Bases: stoqlib.gui.search.productsearch.ProductSearchQuantity

title = u'Production History Search'
report_class

alias of ProductionItemReport

csv_data = None
show_production_columns = True

productsearch Module

Search dialogs for product objects

class stoqlib.gui.search.productsearch.ProductSearch(store, hide_footer=True, hide_toolbar=False, hide_cost_column=False, hide_price_column=False, double_click_confirm=False)[source]

Bases: stoqlib.gui.search.sellablesearch.SellableSearch

title = 'Product Search'
search_spec

alias of ProductFullWithClosedStockView

editor_class

alias of ProductEditor

report_class

alias of ProductReport

has_branch_filter = True
has_status_filter = True
has_print_price_button = True
csv_data = ('Product', 'product')
footer_ok_label = 'Add products'
on_print_price_button_clicked(button)[source]
setup_widgets()[source]
create_filters()[source]
get_editor_class_for_object(obj)[source]
get_editor_model(product_full_stock_view)[source]
run_editor(obj)[source]
get_columns()[source]
executer_query(store)[source]
on_results__has_rows(results, obj)[source]
class stoqlib.gui.search.productsearch.ProductSearchQuantity(store, hide_footer=True, hide_toolbar=True)[source]

Bases: stoqlib.gui.search.productsearch.ProductSearch

title = 'Product History Search'
search_spec

alias of ProductQuantityView

report_class

alias of ProductQuantityReport

csv_data = None
has_print_price_button = False
show_production_columns = False
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb42911a0>]
branch_filter_column

column: PropertyColumn

create_filters()[source]
get_columns()[source]
class stoqlib.gui.search.productsearch.ProductsSoldSearch(store, hide_footer=True, hide_toolbar=True)[source]

Bases: stoqlib.gui.search.productsearch.ProductSearch

title = 'Products Sold Search'
search_spec

alias of SoldItemView

report_class

alias of ProductsSoldReport

csv_data = None
has_print_price_button = False
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb42911a0>]
branch_filter_column

column: PropertyColumn

setup_widgets()[source]
create_filters()[source]
get_columns()[source]
on_search__search_completed(search, result_view, states)[source]
class stoqlib.gui.search.productsearch.ProductStockSearch(store, hide_footer=True, hide_toolbar=False, hide_cost_column=False, hide_price_column=False, double_click_confirm=False)[source]

Bases: stoqlib.gui.search.productsearch.ProductSearch

title = 'Product Stock Search'
search_spec

alias of ProductFullStockItemView

editor_class

alias of ProductStockEditor

report_class

alias of ProductStockReport

csv_data = None
has_print_price_button = False
has_new_button = False
has_status_filter = False
setup_widgets()[source]
get_columns()[source]
executer_query(store)[source]
class stoqlib.gui.search.productsearch.ProductClosedStockSearch(store, hide_footer=True, hide_toolbar=True, hide_cost_column=True, hide_price_column=True)[source]

Bases: stoqlib.gui.search.productsearch.ProductSearch

A SearchEditor for Closed Products

title = 'Closed Product Stock Search'
search_spec

alias of ProductClosedStockView

report_class

alias of ProductClosedStockReport

has_status_filter = False
has_print_price_button = False
has_new_button = False
class stoqlib.gui.search.productsearch.ProductBatchSearch(store, hide_footer=True, hide_toolbar=True)[source]

Bases: stoqlib.gui.search.productsearch.ProductSearch

title = 'Batch Search'
search_spec

alias of ProductBatchView

has_print_price_button = False
csv_data = ('Batch', 'batch')
fast_iter = True
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb42911a0>, <storm.expr.Coalesce object at 0x7f2caff5e360>]
branch_filter_column

column: PropertyColumn

unlimited_results = True
create_filters()[source]
setup_widgets()[source]
get_columns()[source]
class stoqlib.gui.search.productsearch.ProductBrandSearch(store)[source]

Bases: stoqlib.gui.search.searcheditor.SearchEditor

title = 'Brand Search'
size = (775, 450)
search_spec

alias of ProductBrandStockView

editor_class

alias of ProductEditor

report_class

alias of ProductBrandReport

text_field_columns = [<storm.expr.Coalesce object at 0x7f2caff5e520>]
branch_filter_column

column: PropertyColumn

setup_widgets()[source]
create_filters()[source]
get_columns()[source]
class stoqlib.gui.search.productsearch.ProductBrandByBranchSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = 'Brand by Branch Search'
size = (775, 450)
search_spec

alias of ProductBrandByBranchView

report_class

alias of ProductBrandByBranchReport

result_view_class

alias of _ProductBrandResultTreeView

unlimited_results = True
text_field_columns = [<storm.expr.Coalesce object at 0x7f2caff5e440>, <storm.properties.PropertyColumn object at 0x7f2cb4e9dd70>]
setup_widgets()[source]
create_filters()[source]
get_columns()[source]
executer_query(store)[source]
print_report()[source]
class stoqlib.gui.search.productsearch.ProductBranchSearch(store, storable)[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

Show products in stock on all branchs

title = 'Product Branch Search'
size = (600, 500)
search_spec

alias of ProductBranchStockView

text_field_columns = [<storm.expr.Coalesce object at 0x7f2caffafbe8>]
create_filters()[source]
get_columns()[source]
executer_query(store)[source]
stoqlib.gui.search.productsearch.test()[source]

profilesearch Module

Search dialogs for profile objects

class stoqlib.gui.search.profilesearch.UserProfileSearch(store, editor_class=None, interface=None, search_spec=None, hide_footer=True, title='', selection_mode=None, hide_toolbar=False, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searcheditor.SearchEditor

title = 'User Profile Search'
search_spec

alias of UserProfile

editor_class

alias of UserProfileEditor

size = (465, 390)
search_label = 'Profiles Matching:'
create_filters()[source]
get_columns()[source]

purchasesearch Module

Search dialogs for purchase and related objects

class stoqlib.gui.search.purchasesearch.PurchasedItemsSearch(store, hide_footer=True, hide_toolbar=False, hide_cost_column=False, hide_price_column=False, double_click_confirm=False)[source]

Bases: stoqlib.gui.search.productsearch.ProductSearch

title = 'Purchased Items Search'
search_spec

alias of PurchasedItemAndStockView

editor_class

alias of PurchaseItemEditor

report_class

alias of PurchasedItemsReport

csv_data = None
has_print_price_button = False
has_new_button = False
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb42911a0>]
branch_filter_column

column: PropertyColumn

create_filters()[source]
get_columns()[source]
get_editor_model(model)[source]

receivingsearch Module

Search dialogs for purchase receiving

class stoqlib.gui.search.receivingsearch.PurchaseReceivingSearch(store)[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = 'Purchase Receiving Search'
size = (750, 500)
search_spec

alias of PurchaseReceivingView

report_class

alias of PurchaseReceivalReport

selection_mode = <enum GTK_SELECTION_MULTIPLE of type GtkSelectionMode>
branch_filter_column

column: PropertyColumn

text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2caffcec90>, <storm.properties.PropertyColumn object at 0x7f2caffce8a0>, <storm.properties.PropertyColumn object at 0x7f2caff663d0>, <storm.expr.Cast object at 0x7f2caff5d850>]
get_columns()[source]
on_row_activated(klist, receiving_order)[source]
on_details_button_clicked(button)[source]
update_widgets(*args)[source]

returnedsalesearch Module

Search dialogs for returned sales

class stoqlib.gui.search.returnedsalesearch.ReturnedSaleSearch(store)[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = u'Returned Sale Search'
size = (830, 520)
search_spec

alias of ReturnedSalesView

report_class

alias of ReturnedSalesReport

branch_filter_column

column: PropertyColumn

text_field_columns = [<storm.expr.Cast object at 0x7f2caff6cf50>, <storm.expr.Cast object at 0x7f2caff6cf90>, <storm.properties.PropertyColumn object at 0x7f2cb412ac90>, <storm.properties.PropertyColumn object at 0x7f2caff66c90>]
update_widgets()[source]
get_columns()[source]
on_row_activated(klist, item_view)[source]
on_details_button_clicked(button)[source]
class stoqlib.gui.search.returnedsalesearch.PendingReturnedSaleSearch(store)[source]

Bases: stoqlib.gui.search.returnedsalesearch.ReturnedSaleSearch

title = u'Pending Returned Sale Search'
size = (830, 520)
search_spec

alias of PendingReturnedSalesView

branch_filter_column

column: PropertyColumn

get_columns()[source]
on_details_button_clicked(button)[source]
on_row_activated(klist, item_view)[source]
class stoqlib.gui.search.returnedsalesearch.ReturnedItemSearch(store)[source]

Bases: stoqlib.gui.search.returnedsalesearch.ReturnedSaleSearch

title = u'Returned Sale Item Search'
search_spec

alias of ReturnedItemView

report_class

alias of ReturnedItemReport

branch_filter_column

column: PropertyColumn

text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb42911a0>, <storm.properties.PropertyColumn object at 0x7f2caff66c90>]
get_columns()[source]

salespersonsearch Module

class stoqlib.gui.search.salespersonsearch.SalesPersonSalesSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = 'Salesperson Total Sales'
search_spec

alias of SalesPersonSalesView

size = (-1, 450)
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb4e9d3d0>]
branch_filter_column

column: PropertyColumn

create_filters()[source]
get_columns()[source]
setup_widgets()[source]
executer_query(store)[source]

salesearch Module

Search dialogs for sale objects

class stoqlib.gui.search.salesearch.SaleWithToolbarSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.salesearch._BaseSaleSearch

setup_widgets()[source]
class stoqlib.gui.search.salesearch.SaleSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.salesearch._BaseSaleSearch

on_details_button_clicked(button)[source]
class stoqlib.gui.search.salesearch.SalesByPaymentMethodSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.salesearch.SaleWithToolbarSearch

title = u'Search for Sales by Payment Method'
search_spec

alias of SalePaymentMethodView

search_label = 'Items matching:'
size = (800, 450)
branch_filter_column

column: PropertyColumn

text_field_columns = [<storm.expr.Coalesce object at 0x7f2cb41cf830>, <storm.expr.Coalesce object at 0x7f2cb41cf8d8>]
create_filters()[source]
executer_query(store)[source]
get_columns()[source]
class stoqlib.gui.search.salesearch.SoldItemsByBranchSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = u'Sold Items by Branch'
report_class

alias of SoldItemsByBranchReport

search_spec

alias of SoldItemsByBranchView

search_label = 'Items matching:'
size = (800, 450)
unlimited_results = True
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb42911a0>]
branch_filter_column

column: PropertyColumn

setup_widgets()[source]
create_filters()[source]
get_columns()[source]
on_search__search_completed(search, result_view, states)[source]
class stoqlib.gui.search.salesearch.SoldItemsByClientSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = u'Sold Items by Client'
report_class

alias of SoldItemsByClientReport

search_spec

alias of SoldItemsByClient

size = (800, 450)
unlimited_results = True
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb4e9d3d0>, <storm.properties.PropertyColumn object at 0x7f2cb42911a0>, <storm.properties.PropertyColumn object at 0x7f2cb4272f30>]
branch_filter_column

column: PropertyColumn

setup_widgets()[source]
create_filters()[source]
get_columns()[source]
class stoqlib.gui.search.salesearch.UnconfirmedSaleItemsSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = u'Unconfirmed Sale Items Search'
search_spec

alias of UnconfirmedSaleItemsView

size = (850, 450)
branch_filter_column

column: PropertyColumn

unlimited_results = True
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb42911a0>, <storm.properties.PropertyColumn object at 0x7f2caff66830>, <storm.properties.PropertyColumn object at 0x7f2cb412ac90>]
setup_widgets()[source]
update_widgets()[source]
get_columns()[source]
on_sale_details_button__clicked(widget)[source]
on_search__search_completed(search, result_view, states)[source]
class stoqlib.gui.search.salesearch.SaleTokenSearch(store, search_str=None, hide_toolbar=False, hide_footer=False)[source]

Bases: stoqlib.gui.search.searcheditor.SearchEditor

title = u'Sale Token Search'
size = (600, 500)
search_spec

alias of SaleTokenView

editor_class

alias of SaleTokenEditor

text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb411b280>, <storm.properties.PropertyColumn object at 0x7f2cb411b1a0>, <storm.expr.Coalesce object at 0x7f2cb41cf590>, <storm.expr.Coalesce object at 0x7f2cb41cf638>]
get_columns()[source]
get_editor_model(model)[source]

searchcolumns Module

Special columns definition for kiwi lists

class stoqlib.gui.search.searchcolumns.AccessorColumn(attribute, accessor, *args, **kwargs)[source]

Bases: kiwi.ui.objectlist.Column

get_attribute(instance, name, default=None)[source]
class stoqlib.gui.search.searchcolumns.SearchColumn(attribute, title=None, data_type=None, **kwargs)[source]

Bases: kiwi.ui.objectlist.Column

I am a column that should be used in conjunction with stoqlib.gui.search.searchslave.SearchSlave

Parameters:
  • long_title – The title to display in the combo for this field. This is usefull if you need to display a small description on the column header, but still want a full description on the advanced search.
  • valid_values – This should be a list of touples (display value, db value). If provided, then a combo with only this values will be shown, instead of a free text entry.
  • search_attribute – Use this if the name of the db column that should be searched is different than the attribute of the model.
search_label

names the search interface differently from the column

use_having

use the query on the having part instead of the where‘s on

multiple_selection

if we should allow filtering by multiple values

search_attribute

the search attribute to use when filtering by this column

valid_values

valid values to select when filtering by this column

long_title

long title to use in this column

search_func

overrides the function that generates the query to process the search

get_search_label()[source]

Get the search label for this column. This is normally used when constructing a search filter for this column. :returns: the search label

do_get_property(pspec)
do_set_property(pspec, value)
class stoqlib.gui.search.searchcolumns.IdentifierColumn(attribute, title=None, data_type=<type 'int'>, format_func=<type 'str'>, width=80, justify=None, **kwargs)[source]

Bases: stoqlib.gui.search.searchcolumns.SearchColumn

A column for stoqlib.database.properties.IdentifierCol

This is stoqlib.gui.search.searchcolumns.SearchColumn, but with some properties adjusted to properly display identifiers, avoiding lots of code duplication.

One can still overwrite some of those properties, but do that only if necessary! We want identifier to look alike everywhere.

class stoqlib.gui.search.searchcolumns.QuantityColumn(attribute, title=None, width=60, **kwargs)[source]

Bases: stoqlib.gui.search.searchcolumns.SearchColumn

A column for product quantities

This is stoqlib.gui.search.searchcolumns.SearchColumn, but will also display the unit of the product if available in the object

searchdialog Module

class stoqlib.gui.search.searchdialog.SearchDialog(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.base.dialogs.BasicDialog

Base class for all the search dialogs, responsible for the list construction and “Filter” and “Clear” buttons management.

This class must be subclassed and its subclass must implement the methods ‘get_columns’ and ‘get_query_and_args’ (if desired, ‘get_query_and_args’ can be implemented in the user’s slave class, so SearchDialog will get its slave instance and call the method directly). Its subclass also must implement a setup_slaves method and call its equivalent base class method as in:

>>> def setup_slave(self):
...    SearchDialog.setup_slaves(self)

or then, call it in its constructor, like:

>>> def __init__(self, *args):
...     SearchDialog.__init__(self)
main_label_text = ''
title = ''

Title that will appear in the window, for instance ‘Product Search’

search_label = None

The label that will be used for the main filter in this dialog

size = ()

Default size for this dialog

If the advanced search is enabled or disabled. When True we will instrospect the columns returned by get_columns(),and use those that are subclasses of stoqlib.gui.search.searchcolumns.SearchColumn to add as options for the user to filter the results.

report_class = None

the report class used to print a report for the results. If None, the print button will not even be created

tree = False

If the results should use an objecttree instead of objectlist. The result objects should have a get_parent method if this is set.

result_view_class = None

Provide your own result_view_class for the search results. See stoqlib.gui.search.searchresultview.SearchResultTreeView for more information on what should be implemented

fast_iter = False

If we should use the (experimental) fast iter feature of the result set. See stoqlib.database.runtime for more information

text_field_columns = None

If defined, should be a list of properties that will be filtred by the default entry

branch_filter_column = None

If defined, this should be a column from some table that refrences a branch, and a filter will be added for this column

unlimited_results = False

If False, the number of results will respect the parameter MAX_SEARCH_RESULTS. When True, there will be no limit and everything will be displayed

save_columns = True

If the column settings should be saved or not.

search_spec = None
selection_mode = <enum GTK_SELECTION_BROWSE of type GtkSelectionMode>

Selection mode to use (if its possible to select more than one row)

add_button(label, stock=None, image=None)[source]

Adds a button in the bottom of the dialog.

Parameters:
  • label – the text that will be displayed by the button.
  • stock – the gtk stock id to be used in the button.
  • image – the image filename.
add_csv_button(name, prefix)[source]
set_details_button_sensitive(value)[source]
set_print_button_sensitive(value)[source]
get_selection()[source]
confirm(retval=None)[source]

Confirms the dialog :param retval: optional parameter which will be selected when the

dialog is closed
cancel(*args)[source]
print_report()[source]

Returns a birthday query suitable for search filters. This should be assigned on search_column when you want to filter for birth day. e.g.: SearchColumn(‘birth_date’, search_column=self.birthday_search)

set_searchbar_label(label)[source]
set_searchbar_search_string(string)[source]
get_searchbar_search_string()[source]
set_text_field_columns(columns)[source]

See SearchSlave.set_text_field_columns

disable_search_entry()[source]

See SearchSlave.disable_search_entry

add_filter(search_filter, position=<SearchFilterPosition value BOTTOM>, columns=None, callback=None)[source]

See SearchSlave.add_filter

row_activate(obj)[source]

This is called when an item in the results list is double clicked.

Parameters:obj – the item that was double clicked.
add_extension(extension)[source]

Adds the extention to this search.

See :class:`stoqlib.gui.search.searchextention.SearchExtention for more information

add_columns(columns)[source]

Add some columns to the default ones.

Note that this method must be called during the setup of this search, which right now is only possible for those who capture the <stoqlib.gui.events.SearchDialogSetupSearchEvent>

create_branch_filter(label=None, column=None)[source]
create_sellable_filter(label=None)[source]
create_payment_filter(label=None)[source]
create_provider_filter(label=None)[source]
create_salesperson_filter(label=None)[source]
on_search__search_completed(search, results, states)[source]
create_filters()[source]
setup_widgets()[source]
get_columns()[source]
update_widgets()[source]

Subclass can have an ‘update_widgets’, and this method will be called when a signal is emitted by ‘Filter’ or ‘Clear’ buttons and also when a list item is selected.

search_completed(results, states)[source]
class stoqlib.gui.search.searchdialog.SearchDialogPrintSlave(gladefile=None, toplevel_name=None, domain=None, keyactions=None)[source]

Bases: kiwi.ui.delegates.GladeSlaveDelegate

Slave for internal use of SearchEditor, offering an eventbox for a toolbar and managing the ‘print_price_button’ buttons.

domain = 'stoq'
gladefile = 'SearchDialogPrintSlave'
on_print_price_button__clicked(button)[source]
class stoqlib.gui.search.searchdialog.SearchDialogButtonSlave(gladefile=None, toplevel_name=None, domain=None, keyactions=None)[source]

Bases: kiwi.ui.delegates.GladeSlaveDelegate

Slave for internal use of SearchEditor, offering an eventbox for a toolbar and managing buttons.

domain = 'stoq'
gladefile = 'SearchDialogButtonSlave'
on_button__clicked(button)[source]

searcheditor Module

Implementation of basic dialogs for searching data

class stoqlib.gui.search.searcheditor.SearchEditor(store, editor_class=None, interface=None, search_spec=None, hide_footer=True, title='', selection_mode=None, hide_toolbar=False, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

Base class for a search “editor” dialog, that offers a ‘new’ and ‘edit’ button on the dialog footer. The ‘new’ and ‘edit’ buttons will call ‘editor_class’ sending as its parameters a new connection and the object to edit for ‘edit’ button.

This is also a subclass of SearchDialog and the same rules are required.

Simple example:

>>> from kiwi.ui.objectlist import Column
>>> from stoqlib.domain.person import ClientView
>>> from stoqlib.gui.editors.personeditor import ClientEditor
>>> class ClientSearch(SearchEditor):
...     title = _("Client Search")
...     search_spec = ClientView
...     editor_class = ClientEditor
...     size = (465, 390)
...
...     def get_columns(self):
...         return [Column('name', _('Client name'), data_type=str, width=90),
...                 Column('status', _('Status'), data_type=str,
...                         expand=True)]

This will create a new editor called ClientSearch:

  • It will be populated using the table ClientView.
  • The title of the editor is “Client Search”.
  • To create new Client objects or to edit an existing Client object the ClientEditor table will be used, which needs to be a subclass of BaseEditor.
  • The size of the new dialog will be 465 pixels wide and 390 pixels high.
  • When displaying results, the verb client and clients will be used, eg: 1 client or 34 clients.
  • The get_columns() methods is required to be implemented, otherwise there’s no way to know which data is going to be displayed. get_columns must return a list of kiwi objectlist columns. In this case we will display two columns, brand and description. They will be fetched from the client object using the attribute brand or description. Both of them are strings (data_type=str), the width of the first column is 90 pixels and the second column is expanded so it uses the rest of the available width.
has_new_button = True
has_edit_button = True
model_list_lookup_attr = 'id'
editor_class = None
set_edit_button_sensitive(value)[source]

Control sensitivity of button edit

set_edit_button_label(label, stock=None)[source]

Edits label and icon of the edit button

update_widgets(*args)[source]
hide_edit_button()[source]
hide_new_button()[source]
update_edited_item(model)[source]

Update the edited item to its proper type and select it on the list results. This method must be overwritten on subclasses when editors don’t return a valid instance or when returning more than one model.

run(obj=None)[source]
run_dialog(editor_class, parent, *args, **kwargs)[source]
get_editor_class_for_object(obj)[source]
run_editor(obj)[source]
row_activate(obj)[source]

See SearchDialog.row_activate

get_searchlist_model(model)[source]
get_editor_model(model)[source]

This hook must be redefined on child when changing the type of the model is a requirement for edit method.

class stoqlib.gui.search.searcheditor.SearchEditorToolBar(gladefile=None, toplevel_name=None, domain=None, keyactions=None)[source]

Bases: kiwi.ui.delegates.GladeSlaveDelegate

Slave for internal use of SearchEditor, offering an eventbox for a toolbar and managing the ‘New’ and ‘Edit’ buttons.

toplevel_name = 'ToolBar'
gladefile = 'SearchEditor'
domain = 'stoq'
on_edit_button__clicked(button)[source]
on_new_button__clicked(button)[source]

searchextension Module

Search extentions add columns and tables to search dialogs

class stoqlib.gui.search.searchextension.SearchExtension[source]

Bases: object

A SearchExtension is intended to add extra columns to a SearchDialog.

Suppose you have the following dialog:

#>>> class ProductSearch(SearchDialog): #... search_spec = ProductsView #... #... def get_columns(self): #... return [Column(‘name’)]

This is the default search, and it has only one column. The use has the optical plugin installed, and this plugin adds a few more properties to a product, like the color of the product.

A search extention for this dialog would be defined as:

#>>> class OpticalProductSearchExtention(SearchExtension): #... spec_joins = [ #... LeftJoin(OpticalProduct, OpticalProduct.product_id == Product.id) #... ] #... #... spec_attributes = dict( #... color=OpticalProduct.color #... ) #... #... def get_columns(self): #... return [Column(‘color’)]

Then, the plugin should also connect to the event stoqlib.gui.events.SearchDialogSetupSearchEvent and when the desired dialog is being set up, he should attach the extention:

#>>> dialog = ProductSearch() #>>> dialog.add_extention(OpticalProductSearchExtention())

spec_joins = []

A list of table joins that will be added to the query of the search

spec_attributes = {}

A dictionary of the columns that should be queried. Normally columns from the tables specified in the spec_joins above

attach(search)[source]

Attaches this extension to the given search dialog

This will replace the viewable of the dialog by another one that is a subclass of the original, extended with the desired tables and columns, defined in the spec_joins and spec_attributes.

get_columns()[source]

Returns the extra columns that should be added in the search dialog.

If the column is not already present in the original viewable of the search dialog, it should be specified in the spec_attributes above

searchfilters Module

Search filters, graphical widgets to interactively create advanced queries

class stoqlib.gui.search.searchfilters.SearchFilter(label='')[source]

Bases: gtk.HBox

A base class used by common search filters

label

the label of this filter

do_set_property(pspec, value)
do_get_property(pspec)
set_label(label)[source]
get_state()[source]

Implement this in a subclass

get_title_label()[source]
get_mode_combo()[source]
get_description()[source]

Returns a description of the search filter. :returns: a string describing the search filter.

set_removable()[source]
class stoqlib.gui.search.searchfilters.DateSearchFilter(label='')[source]

Bases: stoqlib.gui.search.searchfilters.SearchFilter

A filter which helps you to search by a date interval. Can be customized through add_option.

class Type[source]

Bases: kiwi.python.enum

USER_DAY = <Type value USER_DAY>
USER_INTERVAL = <Type value USER_INTERVAL>
names = {'USER_DAY': <Type value USER_DAY>, 'USER_INTERVAL': <Type value USER_INTERVAL>}
values = {100: <Type value USER_DAY>, 101: <Type value USER_INTERVAL>}
DateSearchFilter.get_state()[source]
DateSearchFilter.set_state(start, end=None)[source]
DateSearchFilter.get_title_label()[source]
DateSearchFilter.get_mode_combo()[source]
DateSearchFilter.get_description()[source]
DateSearchFilter.clear_options()[source]

Removes all previously added options

DateSearchFilter.add_option(option_type, position=-2)[source]

Adds a date option :param option_type: option to add :type option_type: a DateSearchOption subclass

DateSearchFilter.add_option_fixed(name, date, position=-2)[source]

Adds a fixed option, eg one for which date is not possible to modify. :param name: name of the option :param date: fixed data :param position: position to add the option at

DateSearchFilter.add_option_fixed_interval(name, start, end, position=-2)[source]

Adds a fixed option interval, eg one for which the dates are not possible to modify. :param name: name of the option :param start: start of the fixed interval :param end: end of the fixed interval :param position: position to add the option at

DateSearchFilter.add_custom_options()[source]

Adds the custom options ‘Custom day’ and ‘Custom interval’ which let the user define its own interval dates.

DateSearchFilter.get_start_date()[source]

Get the start date. :returns: start date :rtype: datetime.date or None

DateSearchFilter.get_end_date()[source]

Get the end date. :returns: end date :rtype: datetime.date or None

DateSearchFilter.set_use_date_entries(use_date_entries)[source]

Toggles the visibility of the user selectable date entries :param use_date_entries:

DateSearchFilter.select(data=None, position=None)[source]

selects an item in the combo Data or position can be sent in. If nothing is sent in the first item will be selected, if any

Parameters:
  • data – data to select
  • position – position of data to select
class stoqlib.gui.search.searchfilters.ComboSearchFilter(label='', values=None)[source]

Bases: stoqlib.gui.search.searchfilters.SearchFilter

  • a label
  • a combo with a set of predefined item to select from
get_state()[source]
set_state(value, value_id=None, mode=None)[source]
update_values(values)[source]
get_title_label()[source]
get_mode_combo()[source]
get_description()[source]
add_option(option_type, position=0)[source]

Adds an option :param option_type: option to add :type option_type: a ComboSearchOption subclass

select(data)[source]

selects an item in the combo :param data: what to select

enable_advanced()[source]
class stoqlib.gui.search.searchfilters.BoolSearchFilter(label='')[source]

Bases: stoqlib.gui.search.searchfilters.SearchFilter

  • a checkbutton
  • a label
get_state()[source]
set_state(value)[source]
get_title_label()[source]
get_description()[source]
get_mode_combo()[source]
check(data)[source]
uncheck(data)[source]
class stoqlib.gui.search.searchfilters.StringSearchFilter(label, chars=0, container=None)[source]

Bases: stoqlib.gui.search.searchfilters.SearchFilter

Contains:

  • a label
  • an entry
Variables:
  • entry – the entry
  • label – the label
get_state()[source]
set_state(text, mode=None)[source]
get_title_label()[source]
get_mode_combo()[source]
get_description()[source]
enable_advanced()[source]
set_label(label)[source]
class stoqlib.gui.search.searchfilters.NumberSearchFilter(label='')[source]

Bases: stoqlib.gui.search.searchfilters.SearchFilter

A filter which helps you to search by a number interval.

set_digits(digits)[source]

Number of decimal place to be displayed :param digits: number of decimal places

get_state()[source]
set_state(start, end)[source]
get_title_label()[source]
get_mode_combo()[source]
get_description()[source]
add_option(option_type, position=-2)[source]

Adds a date option :param option_type: option to add :type option_type: a NumberSearchOption subclass

class stoqlib.gui.search.searchfilters.MultiSearchFilter(label, items)[source]

Bases: stoqlib.gui.search.searchfilters.SearchFilter

A multi object search filter, containing:

  • a label
  • a multicombo widget
set_label(label)[source]
get_title_label()[source]
get_state()[source]
set_state(values)[source]
get_mode_combo()[source]
get_description()[source]

searchoptions Module

Search options for filters

class stoqlib.gui.search.searchoptions.DateSearchOption[source]

Bases: object

Base class for Date search options A date search option is an interval of dates :cvar name: name of the search option

name = None
get_today_date()[source]
get_interval()[source]

Get start and end date. :returns: start date, end date :rtype: datetime.date tuple

class stoqlib.gui.search.searchoptions.Any[source]

Bases: stoqlib.gui.search.searchoptions.DateSearchOption

name = 'Any'
get_interval()[source]
class stoqlib.gui.search.searchoptions.Yesterday[source]

Bases: stoqlib.gui.search.searchoptions.DateSearchOption

name = 'Yesterday'
get_interval()[source]
class stoqlib.gui.search.searchoptions.Today[source]

Bases: stoqlib.gui.search.searchoptions.DateSearchOption

name = 'Today'
get_interval()[source]
class stoqlib.gui.search.searchoptions.LastWeek[source]

Bases: stoqlib.gui.search.searchoptions.DateSearchOption

name = 'Last week'
get_interval()[source]
class stoqlib.gui.search.searchoptions.ThisWeek[source]

Bases: stoqlib.gui.search.searchoptions.DateSearchOption

name = 'This week'
get_interval()[source]
class stoqlib.gui.search.searchoptions.NextWeek[source]

Bases: stoqlib.gui.search.searchoptions.DateSearchOption

name = 'Next week'
get_interval()[source]
class stoqlib.gui.search.searchoptions.LastMonth[source]

Bases: stoqlib.gui.search.searchoptions.DateSearchOption

name = 'Last month'
get_interval()[source]
class stoqlib.gui.search.searchoptions.ThisMonth[source]

Bases: stoqlib.gui.search.searchoptions.DateSearchOption

name = 'This month'
get_interval()[source]
class stoqlib.gui.search.searchoptions.NextMonth[source]

Bases: stoqlib.gui.search.searchoptions.DateSearchOption

name = 'Next month'
get_interval()[source]
class stoqlib.gui.search.searchoptions.FixedIntervalSearchOption[source]

Bases: stoqlib.gui.search.searchoptions.DateSearchOption

start = None
end = None
get_interval()[source]
class stoqlib.gui.search.searchoptions.FixedDateSearchOption[source]

Bases: stoqlib.gui.search.searchoptions.DateSearchOption

date = None
get_interval()[source]
class stoqlib.gui.search.searchoptions.NumberSearchOption[source]

Bases: object

Base class for Number search options A number search option is an interval of numbers :cvar name: name of the search option :cvar numbers: how many numbers must the user input: 0, 1 or 2

name = None
numbers = 0
get_interval(start, end)[source]

Get start and end interval. :returns: start, end

class stoqlib.gui.search.searchoptions.Between[source]

Bases: stoqlib.gui.search.searchoptions.NumberSearchOption

name = 'Between'
numbers = 2
get_interval(start, end)[source]
class stoqlib.gui.search.searchoptions.EqualsTo[source]

Bases: stoqlib.gui.search.searchoptions.NumberSearchOption

name = 'Equals to'
numbers = 1
get_interval(start, end)[source]
class stoqlib.gui.search.searchoptions.GreaterThan[source]

Bases: stoqlib.gui.search.searchoptions.NumberSearchOption

name = 'Greater or Equal'
numbers = 1
get_interval(start, end)[source]
class stoqlib.gui.search.searchoptions.LowerThan[source]

Bases: stoqlib.gui.search.searchoptions.NumberSearchOption

name = 'Lower or Equal'
numbers = 1
get_interval(start, end)[source]
class stoqlib.gui.search.searchoptions.StringSearchOption[source]

Bases: object

class stoqlib.gui.search.searchoptions.IdenticalTo[source]

Bases: stoqlib.gui.search.searchoptions.StringSearchOption

name = 'Identical to'
mode = 1
class stoqlib.gui.search.searchoptions.ContainsExactly[source]

Bases: stoqlib.gui.search.searchoptions.StringSearchOption

name = 'Contains Exactly'
mode = 0
class stoqlib.gui.search.searchoptions.ContainsAll[source]

Bases: stoqlib.gui.search.searchoptions.StringSearchOption

name = 'Contains All Words'
mode = 3
class stoqlib.gui.search.searchoptions.DoesNotContain[source]

Bases: stoqlib.gui.search.searchoptions.StringSearchOption

name = 'Does Not Contain'
mode = 2
class stoqlib.gui.search.searchoptions.ComboSearchOption[source]

Bases: object

class stoqlib.gui.search.searchoptions.ComboEquals[source]

Bases: stoqlib.gui.search.searchoptions.ComboSearchOption

name = 'Equals to'
mode = 0
class stoqlib.gui.search.searchoptions.ComboDifferent[source]

Bases: stoqlib.gui.search.searchoptions.ComboSearchOption

name = 'Different from'
mode = 1

searchslave Module

class stoqlib.gui.search.searchslave.SearchSlave(columns=None, tree=False, restore_name=None, chars=25, store=None, search_spec=None, fast_iter=False, result_view_class=None)[source]

Bases: kiwi.ui.delegates.SlaveDelegate

A search container is a widget which consists of: - search entry (w/ a label) (StringSearchFilter) - search button - result view (SearchResultListView or class:SearchResultTreeView) - a query executer (stoqlib.database.queryexecuter.QueryExecuter)

Additionally you can add a number of search filters to the SearchContainer. You can chose if you want to add the filter in the top-left corner of bottom, see SearchFilterPosition

result_view_class

alias of SearchResultListView

results
summary_label
clear()[source]

Clears the result list

refresh()[source]

Triggers a search again with the currently selected inputs

search(clear=True)[source]

Starts a search. Fetches the states of all filters and send it to a query executer and finally puts the result in the result class

select(item)[source]
get_selected_item()[source]
focus_search_entry()[source]

Grabs the focus of the search entry

disable_search_entry()[source]

Disables the search entry

Enables an advanced search

add_filter_option(attr, title, data_type, valid_values=None, callback=None, use_having=False, multiple_selection=False)[source]

Adds a new advanced filter option

Use this if you need a filter option in the advanced filters when you don’t have a equivalente SearchColumn in the object list. If its possible to add the column, you should probably do that.

See add_filter_by_attribute for more information

set_message(message)[source]
get_column_by_attribute(attribute)[source]

Returns a column by its model attribute.

set_query(callback)[source]

Overrides the default query mechanism.

Parameters:callback – a callable which till take two arguments (query, store)
set_search_spec(search_spec)[source]

Update the search spec this search uses to search

Parameters:search_spec – a search spec for store to find on
get_query_executer()[source]

Fetchs the QueryExecuter for the SearchContainer

Returns:a querty executer
Return type:a QueryExecuter subclass
add_filter(search_filter, position=<SearchFilterPosition value BOTTOM>, columns=None, callback=None, use_having=False)[source]

Adds a search filter

Parameters:
  • search_filter – the search filter
  • postition – a SearchFilterPosition enum
  • columns
  • callback
remove_filter(filter)[source]
add_filter_by_attribute(attr, title, data_type, valid_values=None, callback=None, use_having=False, multiple_selection=False)[source]

Add a filter accordingly to the attributes specified

Parameters:
  • attr – attribute that will be filtered. This can be either the name of the attribute or the attribute itself.
  • title – the title of the filter that will be visible in the interface
  • data_type – the attribute type (str, bool, decimal, etc)
  • callback – the callback function that will be triggered
  • use_having – use having expression in the query
parse_states()[source]

Returns the states as clauses

get_filter_states()[source]
set_filter_states(dict_state)[source]
get_search_filters()[source]
get_search_filter_by_label(label)[source]
get_primary_filter()[source]

Fetches the primary filter for the SearchContainer. The primary filter is the filter attached to the standard entry normally used to do free text searching :returns: the primary filter

Enables/Disables auto search which means that the search result box is automatically populated when a filter changes :param auto_search: True to enable, False to disable

set_text_field_columns(columns)[source]
set_summary_label(column, label='Total:', format='%s', parent=None)[source]

Adds a summary label to the result set

Parameters:
  • column – the column to sum from
  • label – the label to use, defaults to ‘Total:’
  • format – the format, defaults to ‘%%s’, must include ‘%%s’
  • parent – the parent widget a label should be added to or None if it should be added to the SearchContainer
get_summary_label()[source]
get_last_results()[source]
set_result_view(result_view_class, refresh=False)[source]

Creates a new result view and attaches it to this search container.

If a previous view was created it will be destroyed. :param result_view_class: a result view factory :param refresh: True if the results should be updated

save_columns()[source]
restore_columns(cols)[source]
save_filter_settings(domain, restore_name)[source]

Save filters to user settings

Parameters:
  • domain – settings domain, like “app-ui”
  • restore_name – name of the setting, like “admin”
restore_filter_settings(domain, restore_name)[source]

Restore filters from user settings

Parameters:
  • domain – settings domain, like “app-ui”
  • restore_name – name of the setting, like “admin”
create_branch_filter(label=None, column=None)[source]

Returns a new branch filter.

Parameters:
  • label – The label to be used for the filter
  • column – When provided, besides creating the filter, we will also add it to the interface, filtering by the informed column.
on_result_view__item_activated(result_view, item)[source]
on_result_view__item_popup_menu(result_view, results, event)[source]
on_result_view__selection_changed(result_view, selected)[source]
on_search_button__clicked(button)[source]
on_search_entry__activate(button)[source]

searchresultview Module

class stoqlib.gui.search.searchresultview.SearchResultListView[source]

Bases: kiwi.ui.objectlist.ObjectList

This class implements the ISearchResultView interface on top of a ObjectList.

attach(search, columns)[source]
get_n_items()[source]
search_completed(results)[source]
get_settings()[source]
get_selected_item()[source]
class stoqlib.gui.search.searchresultview.SearchResultTreeView[source]

Bases: kiwi.ui.objectlist.ObjectTree

add_result(result)[source]
attach(search, columns)[source]
get_n_items()[source]
search_completed(results)[source]
get_settings()[source]
get_selected_item()[source]

sellablesearch Module

Implementation of sellable search

class stoqlib.gui.search.sellablesearch.SellableSearch(store, hide_footer=False, hide_toolbar=True, selection_mode=None, search_str=None, search_spec=None, search_query=None, double_click_confirm=True, info_message=None, show_closed_items=False)[source]

Bases: stoqlib.gui.search.searcheditor.SearchEditor

title = 'Item search'
size = (800, 500)
model_list_lookup_attr = 'product_id'
footer_ok_label = '_Select item'
search_spec

alias of SellableFullStockView

editor_class = None
exclude_delivery_service = True
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb42911a0>, <storm.properties.PropertyColumn object at 0x7f2cb42728a0>, <storm.properties.PropertyColumn object at 0x7f2cb4272de0>, <storm.properties.PropertyColumn object at 0x7f2cb4272f30>]
key_shift_Return()[source]
key_control_Return()[source]
key_shift_KP_Enter()[source]
key_control_KP_Enter()[source]
close()[source]
confirm(retval=None)[source]
setup_widgets()[source]
create_filters()[source]
get_columns()[source]
update_widgets()[source]
executer_query(store)[source]
on_image_viewer_toggler__toggled(item)[source]
on_results__right_click(klist, row, event)[source]
on_results__selection_changed(klist, row)[source]
on_branch_stock_button__clicked(widget)[source]
class stoqlib.gui.search.sellablesearch.SaleSellableSearch(store, hide_footer=False, hide_toolbar=True, search_str=None, search_query=None, info_message=None, sale_items=None, quantity=None)[source]

Bases: stoqlib.gui.search.sellablesearch.SellableSearch

footer_ok_label = '_Add sale items'
has_new_button = False
search_completed(results, states)[source]
executer_query(store)[source]
update_widgets()[source]
get_columns()[source]
class stoqlib.gui.search.sellablesearch.PurchaseSellableSearch(store, hide_footer=False, hide_toolbar=False, search_str=None, search_spec=None, search_query=None, info_message=None, supplier=None)[source]

Bases: stoqlib.gui.search.sellablesearch.SellableSearch

editor_class

alias of ProductEditor

get_editor_model(model)[source]
run_editor(obj=None)[source]

sellableunitsearch Module

Implementation of SellableUnit search

class stoqlib.gui.search.sellableunitsearch.SellableUnitSearch(*args, **kwargs)[source]

Bases: stoqlib.gui.search.searcheditor.SearchEditor

A search for stoqlib.domain.sellable.SellableUnit

title = 'Search for Units'
size = (-1, 450)
search_spec

alias of SellableUnit

editor_class

alias of SellableUnitEditor

create_filters()[source]
get_columns()[source]

servicesearch Module

Search dialogs for services

class stoqlib.gui.search.servicesearch.ServiceSearch(store, hide_footer=True, hide_toolbar=False, double_click_confirm=False, hide_cost_column=False, hide_price_column=False)[source]

Bases: stoqlib.gui.search.sellablesearch.SellableSearch

title = 'Service Search'
search_spec

alias of ServiceView

editor_class

alias of ServiceEditor

report_class

alias of ServiceReport

model_list_lookup_attr = 'service_id'
footer_ok_label = 'Add services'
exclude_delivery_service = False
create_filters()[source]
get_editor_model(model)[source]
get_columns()[source]
on_print_price_button_clicked(button)[source]
on_results__has_rows(results, obj)[source]

stationsearch Module

Search dialog for station objects

class stoqlib.gui.search.stationsearch.StationSearch(store, editor_class=None, interface=None, search_spec=None, hide_footer=True, title='', selection_mode=None, hide_toolbar=False, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searcheditor.SearchEditor

title = 'Computer Search'
search_spec

alias of BranchStation

editor_class

alias of StationEditor

size = (-1, 450)
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb4ebb050>]
branch_filter_column

column: PropertyColumn

get_columns()[source]

stockdecreasesearch Module

Search dialogs for stock decreases

class stoqlib.gui.search.stockdecreasesearch.StockDecreaseSearch(store)[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = u'Manual Stock Decrease Search'
size = (750, 500)
search_spec

alias of StockDecreaseView

report_class

alias of StockDecreaseReport

selection_mode = <enum GTK_SELECTION_MULTIPLE of type GtkSelectionMode>
text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb4e9d3d0>, <storm.expr.Coalesce object at 0x7f2caffafef8>, <storm.properties.PropertyColumn object at 0x7f2cb41b68a0>]
branch_filter_column

column: PropertyColumn

update_widgets()[source]
create_filters()[source]
get_columns()[source]
on_row_activated(klist, item)[source]
on_details_button_clicked(button)[source]

taxclasssearch Module

A dialog for sellable categories selection, offering buttons for creation and edition.

class stoqlib.gui.search.taxclasssearch.TaxTemplatesSearch(store, editor_class=None, interface=None, search_spec=None, hide_footer=True, title='', selection_mode=None, hide_toolbar=False, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searcheditor.SearchEditor

size = (500, 350)
title = 'Tax Classes Search'
search_label = 'Class Matching:'
search_spec

alias of ProductTaxTemplate

editor_class

alias of ProductTaxTemplateEditor

text_field_columns = [<storm.properties.PropertyColumn object at 0x7f2cb4210590>]
get_columns()[source]

tillsearch Module

Search dialogs for fiscal objects

class stoqlib.gui.search.tillsearch.TillFiscalOperationsView[source]

Bases: stoqlib.database.viewable.Viewable

Stores informations about till payment tables

Attribute date:the date when the entry was created
Attribute description:
 the entry description
Attribute value:
 the entry value
Attribute station_name:
 the value of name branch_station name column
id

column: PropertyColumn

identifier

column: PropertyColumn

identifier_str = <storm.expr.Cast object>
date

column: PropertyColumn

description

column: PropertyColumn

value

column: PropertyColumn

cfop

column: PropertyColumn

station_name

column: PropertyColumn

branch_id

column: PropertyColumn

status

column: PropertyColumn

tables = [<class 'stoqlib.domain.till.TillEntry'>, <storm.expr.Join object at 0x7f2ca1df8518>, <storm.expr.Join object at 0x7f2ca1df85f0>, <storm.expr.Join object at 0x7f2ca1df8638>, <storm.expr.Join object at 0x7f2ca1df8680>, <storm.expr.Join object at 0x7f2ca1df86c8>, <storm.expr.Join object at 0x7f2ca1df8710>, <storm.expr.Join object at 0x7f2ca1df8758>]
cls_attributes = ['status', 'branch_id', 'description', 'value', 'identifier_str', 'cfop', 'date', 'station_name', 'identifier', 'id']
cls_spec = (<storm.properties.PropertyColumn object at 0x7f2caff55980>, <storm.properties.PropertyColumn object at 0x7f2cb4e54440>, <storm.properties.PropertyColumn object at 0x7f2cb4ed26e0>, <storm.properties.PropertyColumn object at 0x7f2cb4ed2de0>, <storm.expr.Cast object at 0x7f2ca1e52f90>, <storm.properties.PropertyColumn object at 0x7f2cb44fa910>, <storm.properties.PropertyColumn object at 0x7f2cb4ed2a60>, <storm.properties.PropertyColumn object at 0x7f2cb4ebb050>, <storm.properties.PropertyColumn object at 0x7f2cb4ed2910>, <storm.properties.PropertyColumn object at 0x7f2caff55bb0>)
highjacked = {}
class stoqlib.gui.search.tillsearch.TillFiscalOperationsSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = u'Till Fiscal Operations'
search_spec

alias of TillFiscalOperationsView

size = (750, 500)
create_filters()[source]
get_columns(*args)[source]
class stoqlib.gui.search.tillsearch.TillClosedSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = u'Till Search'
search_spec

alias of TillClosedView

size = (750, 500)
searching_by_date = True
branch_filter_column

column: PropertyColumn

setup_widgets()[source]
update_widgets()[source]
create_filters()[source]
get_columns(*args)[source]
on_details_button_clicked(button)[source]

transfersearch Module

Search dialogs for transfer order

class stoqlib.gui.search.transfersearch.TransferOrderSearch(store)[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

title = u'Transfer Order Search'
size = (750, 500)
search_spec

alias of TransferOrderView

report_class

alias of TransferOrderReport

selection_mode = <enum GTK_SELECTION_MULTIPLE of type GtkSelectionMode>
update_widgets()[source]
create_filters()[source]
get_columns()[source]
on_row_activated(klist, view)[source]
on_details_button_clicked(button)[source]
class stoqlib.gui.search.transfersearch.TransferItemSearch(store)[source]

Bases: stoqlib.gui.search.transfersearch.TransferOrderSearch

title = u'Transfer Item Search'
size = (750, 500)
search_spec

alias of TransferItemView

report_class

alias of TransferItemReport

get_columns()[source]

workordersearch Module

class stoqlib.gui.search.workordersearch.WorkOrderSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.searchdialog.SearchDialog

A search for work orders

title = 'Search for work orders'
size = (700, 450)
search_spec

alias of WorkOrderView

editor_class

alias of WorkOrderEditor

create_filters()[source]
get_columns()[source]
on_details_button_clicked(button)[source]
class stoqlib.gui.search.workordersearch.WorkOrderFinishedSearch(store, search_spec=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False, initial_string='')[source]

Bases: stoqlib.gui.search.workordersearch.WorkOrderSearch

search_spec

alias of WorkOrderFinishedView

confirm(retval=None)[source]

Confirms the dialog

Before confirm, we need to check if all items of the selected work order were totally reserved.

Parameters:retval – optional parameter which will be selected when the dialog is closed