wizards Package

wizards Package

abstractwizard Module

Abstract wizard and wizard steps definition

Note that a good aproach for all wizards steps defined here is do not require some specific implementation details for the main wizard. Use instead signals and interfaces for that.

class stoqlib.gui.wizards.abstractwizard.SellableItemSlave(store, parent, model=None, visual_mode=None)[source]

Bases: stoqlib.gui.editors.baseeditor.BaseEditorSlave

A slave for selecting sellable items.

It defines the following:

  • barcode entry
  • quantity spinbutton
  • cost entry
  • add button
  • find product button
  • sellable objectlist

Optionally buttons to modify the list

  • Add
  • Remove
  • Edit

Subclasses should define a sellable_view property and a get_sellable_view_query, both used to define what sellables can be added to the step.

The view used should have the following properties:

  • barcode
  • description
  • category_description

and should also provide an acessor that returns the sellable object.

gladefile = 'SellableItemSlave'
proxy_widgets = ('quantity', 'unit_label', 'cost', 'minimum_quantity', 'stock_quantity', 'sellable_description')
summary_label_text = None
summary_label_column = 'total'
value_column = 'cost'
sellable_view

alias of ProductFullStockItemView

sellable_editable = False
validate_stock = False
validate_price = False

If we should also validate the price of the sellable. (checking if it is respecting the rules of discount

cost_editable = True
item_editor = None
batch_selection_dialog = None

the sellable search class used to select a sellable to add on the list

alias of SellableSearch

allow_no_batch = False

if we should allow to add an item without available batches (no stock). Can happen when selecting a product that control batches for decrease, in that case, get_order_item() will receive batch=None

calculator_mode = None

the mode to pass to the stoqlib.gui.widgets.calculator.CalculatorPopup. If None, the calculator will not be attached

add_sellable_on_barcode_activate = False

If we should add the sellable on the list when activating the barcode. This is useful when the barcode is supposed to work with barcode readers. Note that, if the sellable with the given barcode wasn’t found, it’ll just be cleared and no error message will be displayed

stock_labels_visible = True

If we should make visible a label showing the stock and the minimum quantity of a sellable when one is selected. Note that sellables without storables (e.g. services) won’t have them shown anyway

setup_proxies()[source]
setup_slaves()[source]
update_visual_mode()[source]
add_sellable(sellable, parent=None)[source]

Add a sellable to the current step

This will call step.get_order_item to create the correct item for the current model, and this created item will be returned.

remove_items(items)[source]

Remove items from the current IContainer.

Subclasses can override this if special logic is necessary.

hide_item_addition_toolbar()[source]
hide_add_button()[source]

Hides the add button

hide_del_button()[source]

Hides the del button

hide_edit_button()[source]

Hides the edit button

get_quantity()[source]

Returns the quantity of the current model or 1 if there is no model :returns: the quantity

get_model_item_by_sellable(sellable)[source]

Returns a model instance by the given sellable. :returns: a model instance or None if we could not find the model.

get_remaining_quantity(sellable, batch=None)[source]

Returns the remaining quantity in stock for the given sellable

This will check the remaining quantity in stock taking the items on the list in consideration. This is very useful since these items still haven’t decreased stock.

Parameters:
  • sellable – the sellable to be checked for remaining quantity
  • batch – if not None, the remaining quantity will be checked taking the batch in consideration
Returns:

the remaining quantity or None if the sellable doesn’t control stock (e.g. a service)

update_total()[source]

Update the summary label with the current total

get_parent()[source]
validate(value)[source]
get_sellable_view_query()[source]

This method should return a tuple containing the viewable that should be used and a query that should filter the sellables that can and cannot be added to this step.

get_order_item(sellable, value, quantity, batch=None, parent=None)[source]

Adds the sellable to the current model

This method is called when the user added the sellable in the wizard step. Subclasses should implement this method to add the sellable to the current model.

Parameters:
  • sellable – the selected sellable
  • value – the value selected for the sellable
  • quantity – the quantity selected for the sellable
  • batch – the batch that was selected for the sellable. Note that this argument will only be passed if batch_selection_dialog is defined.
get_saved_items()[source]
get_columns()[source]
can_add_sellable(sellable)[source]

Whether we can add a sellable to the list or not

This is a hook method that gets called when trying to add a sellable to the list. It can be rewritten on child classes for extra functionality :param sellable: the selected sellable :returns: True or False (True by default)

get_sellable_model(sellable, batch=None)[source]

Create a Settable containing multiple information to be used on the slave.

Parameters:sellable – a sellable we are adding to wizard
Returns:a Settable containing some information of the item
sellable_selected(sellable, batch=None)[source]

This will be called when a sellable is selected in the combo. It can be overriden in a subclass if they wish to do additional logic at that point

Parameters:
  • sellable – the selected sellable
  • batch – the batch, if the sellable was selected by it’s batch_number
get_batch_items()[source]

Get batch items for sellables inside this slave

Returns:a dict mapping the batch to it’s quantity
get_batch_order_items(sellable, value, quantity)[source]

Get order items for sellable considering it’s batches

By default, this will run batch_selection_dialog to get the batches and their quantities and then call get_order_item() on each one.

Parameters:
  • sellable – a sellable
  • value – the value (e.g. price, cost) of the sellable
  • quantity – the quantity of the sellable
get_extra_discount(sellable)[source]

Called to get an extra discount for the sellable being added

Subclasses can implement this to allow some extra discount for the sellable being added. For example, one can implement this to allow some extra discount based on the unused discount on the already added items

Note that, if you need to get the manager to check for max discount, you can use manager

Parameters:sellable – the sellable being added
Returns:the extra discount for the sellable being added, or None if not extra discount should be allowed
get_sellable_search_extra_kwargs()[source]

Called to get extra args for sellable_search

A subclass can override this and return a dict with extra keywords to pass to the sellable search defined on the class.

Returns:a dict of extra keywords
on_add_sellable_button__clicked(button)[source]
on_product_button__clicked(button)[source]
on_barcode__activate(widget)[source]
on_quantity__activate(entry)[source]
on_cost__activate(entry)[source]
on_quantity__validate(entry, value)[source]
on_cost__validate(widget, value)[source]
on_cost__icon_press(entry, icon_pos, event)[source]
class stoqlib.gui.wizards.abstractwizard.SellableItemStep(wizard, previous, store, model)[source]

Bases: stoqlib.gui.wizards.abstractwizard.SellableItemSlave, stoqlib.gui.base.wizards.WizardStep

model_type = None
get_parent()[source]
post_init()[source]
validate(value)[source]
validate_step()[source]
get_component(parent, sellable)[source]

consignmentwizard Module

Consignment wizard definition

class stoqlib.gui.wizards.consignmentwizard.StartConsignmentStep(wizard, store, model)[source]

Bases: stoqlib.gui.wizards.purchasewizard.StartPurchaseStep

next_step()[source]
class stoqlib.gui.wizards.consignmentwizard.ConsignmentItemStep(wizard, previous, store, model)[source]

Bases: stoqlib.gui.wizards.purchasewizard.PurchaseItemStep

has_next_step()[source]
next_step()[source]
class stoqlib.gui.wizards.consignmentwizard.ConsignmentSelectionStep(wizard, store)[source]

Bases: stoqlib.gui.wizards.receivingwizard.PurchaseSelectionStep

get_extra_query(states)[source]
next_step()[source]
class stoqlib.gui.wizards.consignmentwizard.ConsignmentItemSelectionStep(wizard, previous, store, consignment)[source]

Bases: stoqlib.gui.base.wizards.BaseWizardStep

gladefile = 'ConsignmentItemSelectionStep'
get_saved_items()[source]
get_columns()[source]
post_init()[source]
has_previous_step()[source]
has_next_step()[source]
next_step()[source]
on_consignment_items__selection_changed(widget, item)[source]
on_consignment_items__row_activated(widget, item)[source]
on_edit_button__clicked(widget)[source]
class stoqlib.gui.wizards.consignmentwizard.CloseConsignmentPaymentStep(wizard, previous, store, consignment, outstanding_value=Decimal('0'))[source]

Bases: stoqlib.gui.base.wizards.BaseWizardStep

gladefile = 'HolderTemplate'
slave_holder = 'place_holder'
validate_step()[source]
post_init()[source]
has_next_step()[source]
class stoqlib.gui.wizards.consignmentwizard.ConsignmentWizard(store, model=None)[source]

Bases: stoqlib.gui.wizards.purchasewizard.PurchaseWizard

title = 'New Consignment'
help_section = None
class stoqlib.gui.wizards.consignmentwizard.CloseInConsignmentWizard(store)[source]

Bases: stoqlib.gui.base.wizards.BaseWizard

title = 'Closing In Consignment'
size = (790, 400)
finish()[source]

inventorywizard Module

class stoqlib.gui.wizards.inventorywizard.InventoryCountTypeStep(store, wizard, previous=None)[source]

Bases: stoqlib.gui.base.wizards.BaseWizardStep

Step responsible for defining the type of the count

A simple step that will present 2 radiobutton options for the user to choose between an assisted count and a manual count.

gladefile = 'InventoryCountTypeStep'
next_step()[source]
on_manual_count__toggled(radio)[source]
on_import_count__toggled(radio)[source]
on_import_file__file_set(chooser)[source]
class stoqlib.gui.wizards.inventorywizard.InventoryCountItemStep(wizard, previous, store, model)[source]

Bases: stoqlib.gui.wizards.abstractwizard.SellableItemStep

Step responsible for the real products counting

This step will behave different, depending on the InventoryCountTypeStep‘s choice. For example:

  • If we choose to do a manual counting, all items will be populated and the user will be able to inform the quantity of each one
  • If we choose to do an assisted counting, no items will be populated (with the exception of the ones already counted before) and the user will be able to add items as it scans the barcode.

Note that on the assisted count, pressing enter on the barcode will add the item on the list and not focus the quantity entry. That’s done to make it easier for counting items using a barcode scanner.

model_type

alias of Inventory

item_table

alias of _TemporaryInventoryItem

summary_label_text = u'<b>Total quantity:</b>'
summary_label_column = 'quantity'
sellable_editable = False
stock_labels_visible = False
batch_selection_dialog

alias of _InventoryBatchSelectionDialog

add_sellable_on_barcode_activate = True
post_init()[source]
get_order_item(sellable, cost, quantity, batch=None, parent=None)[source]
get_saved_items()[source]
get_batch_items()[source]
get_batch_order_items(sellable, value, quantity)[source]
get_columns()[source]
has_next_step()[source]
validate(value)[source]
on_barcode__activate(widget)[source]
class stoqlib.gui.wizards.inventorywizard.InventoryCountWizard(store, model)[source]

Bases: stoqlib.gui.base.wizards.BaseWizard

A wizard for counting items on an inventory

size = (800, 450)
title = 'Inventory product counting'
help_section = 'inventory-count'
finish()[source]

loanwizard Module

Loan wizard

class stoqlib.gui.wizards.loanwizard.StartNewLoanStep(store, wizard, model=None, previous=None)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

gladefile = 'SalesPersonStep'
model_type

alias of Loan

proxy_widgets = ['client', 'salesperson', 'expire_date', 'client_category']
post_init()[source]
next_step()[source]
has_previous_step()[source]
setup_proxies()[source]
on_client__changed(widget)[source]
on_expire_date__validate(widget, value)[source]
on_observations_button__clicked(*args)[source]
on_client__validate(widget, client)[source]
class stoqlib.gui.wizards.loanwizard.LoanItemStep(wizard, previous, store, model)[source]

Bases: stoqlib.gui.wizards.salequotewizard.SaleQuoteItemStep

Wizard step for loan items selection

change_remove_btn_sensitive = False
model_type

alias of Loan

item_table

alias of LoanItem

sellable_view

alias of ProductWithStockBranchView

item_editor

alias of LoanItemEditor

validate_stock = True
batch_selection_dialog

alias of BatchDecreaseSelectionDialog

get_sellable_view_query()[source]
get_order_item(sellable, price, quantity, batch=None, parent=None)[source]
has_next_step()[source]
class stoqlib.gui.wizards.loanwizard.LoanSelectionStep(wizard, store)[source]

Bases: stoqlib.gui.base.wizards.BaseWizardStep

gladefile = 'HolderTemplate'
get_extra_query(states)[source]
setup_slaves()[source]
has_previous_step()[source]
post_init()[source]
next_step()[source]
class stoqlib.gui.wizards.loanwizard.LoanItemSelectionStep(wizard, previous, store, model)[source]

Bases: stoqlib.gui.wizards.abstractwizard.SellableItemStep

model_type

alias of list

item_table

alias of LoanItem

cost_editable = False
summary_label_column = None
has_next_step()[source]
post_init()[source]
get_columns()[source]
get_saved_items()[source]
validate_step()[source]
validate(value)[source]
class stoqlib.gui.wizards.loanwizard.NewLoanWizard(store, model=None)[source]

Bases: stoqlib.gui.base.wizards.BaseWizard

size = (775, 400)
help_section = 'loan'
finish()[source]
class stoqlib.gui.wizards.loanwizard.CloseLoanWizard(store, create_sale=True, require_sale_items=False)[source]

Bases: stoqlib.gui.base.wizards.BaseWizard

size = (775, 400)
title = u'Close Loan Wizard'
help_section = 'loan'
get_sold_items()[source]

Get items set to be sold on this wizard

Returns a list of sold sellables, the quantity sold of those sellables and the price it was sold at.

Returns:a list of tuples (sellable, quantity, price)
finish()[source]
stoqlib.gui.wizards.loanwizard.test()[source]

personwizard Module

Person role wizards definition

class stoqlib.gui.wizards.personwizard.RoleEditorStep(wizard, store, previous, role_type, person=None, document=None, description=None)[source]

Bases: stoqlib.gui.base.wizards.BaseWizardStep

gladefile = 'HolderTemplate'
post_init()[source]
previous_step()[source]
has_next_step()[source]
class stoqlib.gui.wizards.personwizard.PersonRoleTypeStep(wizard, store, document=None, description=None)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

gladefile = 'PersonRoleTypeStep'
model_type

alias of Settable

create_model(store)[source]
setup_proxies()[source]
next_step()[source]
has_previous_step()[source]
on_person_document__activate(entry)[source]
on_person_document__validate(entry, value)[source]
on_individual_check__toggled(*args)[source]

Change document labels based on check button

Changes the document_label (proxy_widget) with the right document (CPF or CNPJ) that will be inserted on the person_document entry. Also changes the mask of person_document when is necessary

class stoqlib.gui.wizards.personwizard.PersonRoleWizard(store, role_editor, document=None, description=None)[source]

Bases: stoqlib.gui.base.wizards.BaseWizard

size = (650, 450)
get_first_step(store)[source]
get_role_name()[source]
get_role_title()[source]
set_editor(editor)[source]
finish()[source]
stoqlib.gui.wizards.personwizard.run_person_role_dialog(role_editor, parent, store, model=None, **editor_kwargs)[source]

productionwizard Module

Production wizard definition

class stoqlib.gui.wizards.productionwizard.OpenProductionOrderStep(store, wizard, model)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

gladefile = 'OpenProductionOrderStep'
model_type

alias of ProductionOrder

proxy_widgets = ['open_date', 'expected_start_date', 'identifier', 'branch', 'responsible', 'description']
post_init()[source]
next_step()[source]
has_previous_step()[source]
setup_proxies()[source]
on_expected_start_date__validate(widget, value)[source]
class stoqlib.gui.wizards.productionwizard.ProductionServiceStep(wizard, previous, store, model)[source]

Bases: stoqlib.gui.wizards.abstractwizard.SellableItemStep

model_type

alias of ProductionOrder

item_table

alias of ProductionService

summary_label_text = u'<b>Total:</b>'
summary_label_column = 'quantity'
sellable_view

alias of ServiceView

item_editor

alias of ProductionServiceEditor

get_sellable_view_query()[source]
setup_slaves()[source]
validate(value)[source]
get_order_item(sellable, cost, quantity, batch=None, parent=None)[source]
get_saved_items()[source]
get_columns()[source]
remove_items(items)[source]
next_step()[source]
class stoqlib.gui.wizards.productionwizard.ProductionItemStep(wizard, previous, store, model)[source]

Bases: stoqlib.gui.wizards.abstractwizard.SellableItemStep

Wizard step for production items selection

model_type

alias of ProductionOrder

item_table

alias of ProductionItem

summary_label_text = u'<b>Total:</b>'
summary_label_column = 'quantity'
sellable_view

alias of ProductComponentView

item_editor

alias of ProductionItemEditor

get_sellable_view_query()[source]
setup_slaves()[source]
get_order_item(sellable, cost, quantity, batch=None, parent=None)[source]
get_saved_items()[source]
get_columns()[source]
next_step()[source]
class stoqlib.gui.wizards.productionwizard.FinishOpenProductionOrderStep(wizard, previous, store, model)[source]

Bases: stoqlib.gui.base.wizards.BaseWizardStep

gladefile = 'HolderTemplate'
model_type

alias of ProductionOrder

proxy_widgets = []
has_next_step()[source]
post_init()[source]
validate_step()[source]
class stoqlib.gui.wizards.productionwizard.ProductionWizard(store, model=None, edit_mode=False)[source]

Bases: stoqlib.gui.base.wizards.BaseWizard

size = (775, 400)
finish()[source]

productwizard Module

class stoqlib.gui.wizards.productwizard.ProductTypeStep(store, wizard, previous=None)[source]

Bases: stoqlib.gui.base.wizards.BaseWizardStep

gladefile = 'ProductTypeStep'
next_step()[source]
on_common__toggled(radio)[source]
on_batch__toggled(radio)[source]
on_without_stock__toggled(radio)[source]
on_consigned__toggled(radio)[source]
on_grid__toggled(radio)[source]
on_package__toggled(radio)[source]
class stoqlib.gui.wizards.productwizard.ProductAttributeEditorStep(store, wizard, previous)[source]

Bases: stoqlib.gui.base.wizards.BaseWizardStep

gladefile = 'HolderTemplate'
validate_step()[source]
next_step()[source]
class stoqlib.gui.wizards.productwizard.ProductEditorStep(store, wizard, previous=None)[source]

Bases: stoqlib.gui.base.wizards.BaseWizardStep

gladefile = 'HolderTemplate'
post_init()[source]
previous_step()[source]
has_next_step()[source]
class stoqlib.gui.wizards.productwizard.ProductCreateWizard(store, *args, **kwargs)[source]

Bases: stoqlib.gui.base.wizards.BaseWizard

size = (800, 450)
title = 'Product creation wizard'
help_section = 'product-new'
need_cancel_confirmation = True
finish()[source]
cancel()[source]
classmethod run_wizard(parent)[source]

Run the wizard to create a product

This will run the wizard and after finishing, ask if the user wants to create another product alike. The product will be cloned and stoqlib.gui.editors.producteditor.ProductEditor will run as long as the user chooses to create one alike

purchasefinishwizard Module

Purchase Finish Wizard

class stoqlib.gui.wizards.purchasefinishwizard.PurchaseFinishProductListStep(store, wizard, model)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

gladefile = 'PurchaseFinishProductListStep'
model_type

alias of Settable

proxy_widgets = ()
next_step()[source]
has_previous_step()[source]
class stoqlib.gui.wizards.purchasefinishwizard.PurchaseFinishPaymentAdjustStep(store, wizard, model=None, previous=None)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

gladefile = 'PurchaseFinishPaymentAdjustStep'
model_type

alias of Settable

proxy_widgets = ('received_value', 'paid_value', 'missing_value')
has_next_step()[source]
next_step()[source]
setup_proxies()[source]
class stoqlib.gui.wizards.purchasefinishwizard.PurchaseFinishPaymentStep(wizard, previous, store, model)[source]

Bases: stoqlib.gui.wizards.purchasewizard.PurchasePaymentStep

has_next_step()[source]
class stoqlib.gui.wizards.purchasefinishwizard.PurchaseFinishWizard(store, purchase)[source]

Bases: stoqlib.gui.base.wizards.BaseWizard

size = (775, 400)
title = 'Purchase Finish'
is_for_another_branch()[source]
finish()[source]

When finishing this wizard is necessary to check if the paid value was less or more than the received value. If the paid value was lesser than what was received is created a new payment. Otherwise a return payment is created for the purchase.

purchasequotewizard Module

Purchase quote wizard definition

class stoqlib.gui.wizards.purchasequotewizard.StartQuoteStep(wizard, previous, store, model)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

gladefile = 'StartQuoteStep'
model_type

alias of PurchaseOrder

proxy_widgets = ['open_date', 'quote_deadline', 'branch_combo', 'notes']
post_init()[source]
next_step()[source]
setup_proxies()[source]
on_quote_deadline__validate(widget, date)[source]
class stoqlib.gui.wizards.purchasequotewizard.QuoteItemStep(wizard, previous, store, model)[source]

Bases: stoqlib.gui.wizards.purchasewizard.PurchaseItemStep

item_editor

alias of PurchaseQuoteItemEditor

get_sellable_view_query()[source]
setup_slaves()[source]
get_order_item(sellable, cost, quantity, batch=None, parent=None)[source]
get_columns()[source]
validate(value)[source]
post_init()[source]
has_next_step()[source]
next_step()[source]
class stoqlib.gui.wizards.purchasequotewizard.QuoteSupplierStep(wizard, previous, store, model)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

gladefile = 'QuoteSupplierStep'
model_type

alias of PurchaseOrder

product_columns = [<Column: {'_property_helper_attribute': 'description', '_property_helper_expand': True, '_objectlist': None, '_data_type': <type 'str'>, '_property_helper_ellipsize': <enum PANGO_ELLIPSIZE_END of type PangoEllipsizeMode>, 'from_string': <bound method _StringConverter.from_string of <kiwi.datatypes._StringConverter object at 0x7f2cd15b7e10>>, '_property_helper_title': 'Product'}>]
validate_step()[source]
has_next_step()[source]
post_init()[source]
on_print_button__clicked(widget)[source]
on_missing_products_button__clicked(widget)[source]
on_view_products_button__clicked(widget)[source]
on_quoting_list__selection_changed(widget, item)[source]
on_quoting_list__cell_edited(widget, item, cell)[source]
on_quoting_list__row_activated(widget, item)[source]
class stoqlib.gui.wizards.purchasequotewizard.QuoteGroupSelectionStep(wizard, store)[source]

Bases: stoqlib.gui.base.wizards.BaseWizardStep

gladefile = 'QuoteGroupSelectionStep'
next_step()[source]
on_edit_button__clicked(widget)[source]
on_remove_button__clicked(widget)[source]
class stoqlib.gui.wizards.purchasequotewizard.QuoteGroupItemsSelectionStep(wizard, store, group, previous=None)[source]

Bases: stoqlib.gui.base.wizards.BaseWizardStep

gladefile = 'QuoteGroupItemsSelectionStep'
post_init()[source]
has_next_step()[source]
on_select_all_button__clicked(widget)[source]
on_unselect_all_button__clicked(widget)[source]
on_cancel_group_button__clicked(widget)[source]
on_create_order_button__clicked(widget)[source]
class stoqlib.gui.wizards.purchasequotewizard.QuotePurchaseWizard(store, model=None)[source]

Bases: stoqlib.gui.base.wizards.BaseWizard

size = (775, 400)
finish()[source]
class stoqlib.gui.wizards.purchasequotewizard.ReceiveQuoteWizard(store)[source]

Bases: stoqlib.gui.base.wizards.BaseWizard

title = 'Receive Quote Wizard'
size = (750, 450)
finish()[source]

purchasewizard Module

Purchase wizard definition

class stoqlib.gui.wizards.purchasewizard.StartPurchaseStep(wizard, store, model)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

gladefile = 'StartPurchaseStep'
model_type

alias of PurchaseOrder

proxy_widgets = ['open_date', 'identifier', 'supplier', 'branch', 'expected_freight']
post_init()[source]
next_step()[source]
has_previous_step()[source]
setup_proxies()[source]
on_fob_radio__toggled(*args)[source]
on_add_supplier__clicked(button)[source]
on_supplier__content_changed(supplier)[source]
on_edit_supplier__clicked(button)[source]
on_open_date__validate(widget, date)[source]
on_expected_freight__validate(widget, value)[source]
class stoqlib.gui.wizards.purchasewizard.PurchaseItemStep(wizard, previous, store, model)[source]

Bases: stoqlib.gui.wizards.abstractwizard.SellableItemStep

Wizard step for purchase order’s items selection

model_type

alias of PurchaseOrder

item_table

alias of PurchaseItem

summary_label_text = u'<b>Total Ordered:</b>'
sellable_editable = True
item_editor

alias of PurchaseItemEditor

alias of PurchaseSellableSearch

get_sellable_view_query()[source]
setup_slaves()[source]
validate(value)[source]
get_order_item(sellable, cost, quantity, batch=None, parent=None)[source]
get_saved_items()[source]
sellable_selected(sellable, batch=None)[source]
get_sellable_search_extra_kwargs()[source]
get_columns()[source]
next_step()[source]
class stoqlib.gui.wizards.purchasewizard.PurchasePaymentStep(wizard, previous, store, model, outstanding_value=<currency $0>)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

gladefile = 'PurchasePaymentStep'
model_type

alias of PaymentGroup

validate_step()[source]
next_step()[source]
post_init()[source]
setup_proxies()[source]
class stoqlib.gui.wizards.purchasewizard.FinishPurchaseStep(store, wizard, model=None, previous=None)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

gladefile = 'FinishPurchaseStep'
model_type

alias of PurchaseOrder

proxy_widgets = ('salesperson_name', 'expected_receival_date', 'transporter', 'notes')
has_next_step()[source]
next_step()[source]
post_init()[source]
setup_proxies()[source]
on_expected_receival_date__validate(widget, date)[source]
on_add_transporter__clicked(button)[source]
on_edit_transporter__clicked(button)[source]
on_transporter__content_changed(category)[source]
on_receive_now__toggled(widget)[source]
on_print_button__clicked(button)[source]
class stoqlib.gui.wizards.purchasewizard.PurchaseWizard(store, model=None, edit_mode=False)[source]

Bases: stoqlib.gui.base.wizards.BaseWizard

size = (775, 400)
help_section = 'purchase-new'
need_cancel_confirmation = True
is_for_another_branch()[source]
finish()[source]
stoqlib.gui.wizards.purchasewizard.test()[source]

receivingwizard Module

Receiving wizard definition

class stoqlib.gui.wizards.receivingwizard.PurchaseSelectionStep(wizard, store)[source]

Bases: stoqlib.gui.base.wizards.BaseWizardStep

gladefile = 'PurchaseSelectionStep'
get_extra_query(states)[source]
post_init()[source]
next_step()[source]
has_previous_step()[source]
setup_slaves()[source]
on_details_button__clicked(*args)[source]
class stoqlib.gui.wizards.receivingwizard.ReceivingOrderItemStep(store, wizard, previous_step, purchases)[source]

Bases: stoqlib.gui.base.wizards.BaseWizardStep

gladefile = 'ReceivingOrderItemStep'
model_type

alias of ReceivingOrder

post_init()[source]
next_step()[source]
validate_step()[source]
on_purchase_items__cell_edited(purchase_items, obj, attr)[source]
on_purchase_items__cell_editing_started(purchase_items, obj, attr, renderer, editable)[source]
on_purchase_items__selection_changed(purchase_items, item)[source]
on_purchase_items__row_activated(purchase_items, item)[source]
on_edit_btn__clicked(button)[source]
class stoqlib.gui.wizards.receivingwizard.ReceivingInvoiceStep(store, wizard, model=None, previous=None)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

gladefile = 'HolderTemplate'
model_type

alias of ReceivingOrder

has_next_step()[source]
post_init()[source]
validate_step()[source]
class stoqlib.gui.wizards.receivingwizard.ReceivingOrderWizard(store)[source]

Bases: stoqlib.gui.base.wizards.BaseWizard

title = 'Receive Purchase Order'
size = (750, 350)
need_cancel_confirmation = True
finish()[source]

renegotiationwizard Module

Payments Renegotiation Wizard

class stoqlib.gui.wizards.renegotiationwizard.PaymentRenegotiationPaymentListStep(store, wizard, model, groups)[source]

Bases: stoqlib.gui.wizards.salewizard.BaseMethodSelectionStep, stoqlib.gui.base.wizards.WizardEditorStep

gladefile = 'PaymentRenegotiationPaymentListStep'
model_type

alias of PaymentRenegotiation

proxy_widgets = ('surcharge_value', 'discount_value', 'total')
post_init()[source]
setup_proxies()[source]
on_surcharge_value__validate(entry, value)[source]
on_discount_value__validate(entry, value)[source]
after_surcharge_value__changed(entry)[source]
after_discount_value__changed(entry)[source]
class stoqlib.gui.wizards.renegotiationwizard.PaymentRenegotiationWizard(store, groups)[source]

Bases: stoqlib.gui.base.wizards.BaseWizard

size = (550, 400)
title = 'Payments Renegotiation Wizard'
need_create_payment()[source]
get_total_amount()[source]
get_total_paid()[source]
get_total_to_pay()[source]
finish()[source]

salequotewizard Module

Sale quote wizard

class stoqlib.gui.wizards.salequotewizard.StartSaleQuoteStep(store, wizard, model=None, previous=None)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

gladefile = 'SalesPersonQuoteWizardStep'
model_type

alias of Sale

sale_widgets = ['client', 'salesperson', 'expire_date', 'client_category']
invoice_widgets = ['operation_nature']
cfop_widgets = ['cfop']
proxy_widgets = ['client', 'salesperson', 'expire_date', 'client_category', 'operation_nature', 'cfop']
post_init()[source]
next_step()[source]
has_previous_step()[source]
setup_proxies()[source]
toogle_client_details()[source]
after_client__content_changed(widget)[source]
on_expire_date__validate(widget, value)[source]
on_notes_button__clicked(*args)[source]
on_create_cfop__clicked(widget)[source]
on_client__validate(widget, client)[source]
class stoqlib.gui.wizards.salequotewizard.SaleQuoteItemStep(wizard, previous, store, model)[source]

Bases: stoqlib.gui.wizards.abstractwizard.SellableItemStep

Wizard step for purchase order’s items selection

change_remove_btn_sensitive = True
model_type

alias of Sale

item_table

alias of SaleItem

summary_label_text = u'<b>Total Ordered:</b>'
sellable = None
sellable_view

alias of SellableFullStockView

item_editor

alias of SaleQuoteItemEditor

validate_price = True
value_column = 'price'
calculator_mode = 1
get_sellable_view_query()[source]
setup_slaves()[source]
update_total()[source]
add_sellable(sellable, parent=None)[source]
get_order_item(sellable, price, quantity, batch=None, parent=None)[source]
Parameters:
  • sellable – the sellable
  • price – the price the sellable is being sold
  • quantity – the quantity for that is being sold
  • batch – the |storable_batch| if exists
  • parent|sale_item|‘s parent_item if exists
get_saved_items()[source]
get_columns()[source]
sellable_selected(sellable, batch=None)[source]
can_add_sellable(sellable)[source]
get_extra_discount(sellable)[source]
validate_step()[source]
next_step()[source]
has_next_step()[source]
on_slave__before_edit_item(slave, item)[source]
on_slave__on_edit_item(slave, item)[source]
on_slave__before_delete_items(klist, items)[source]
on_discount_btn__clicked(button)[source]
on_delivery_btn__clicked(btn)[source]
class stoqlib.gui.wizards.salequotewizard.SaleQuotePaymentStep(store, wizard, model=None, previous=None)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

A step for creating payments for a sale

All this step does is to attach stoqlib.gui.slaves.paymentslave.MultipleMethodSlave, so see it for more information

gladefile = 'HolderTemplate'
model_type

alias of Sale

post_init()[source]
setup_slaves()[source]
has_next_step()[source]
class stoqlib.gui.wizards.salequotewizard.SaleQuoteWizard(store, model=None)[source]

Bases: stoqlib.gui.base.wizards.BaseWizard

size = (775, 400)
help_section = 'sale-quote'
need_cancel_confirmation = True
get_first_step(store, model)[source]

Returns the first step of this wizard.

Subclasses can override this if they want to change the first step, without overriding __init__.

get_title(model=None)[source]
print_quote_details(quote, payments_created=False)[source]
finish()[source]

salereturnwizard Module

Sale return wizards definition

class stoqlib.gui.wizards.salereturnwizard.SaleReturnSelectionStep(store, wizard, model=None, previous=None)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

gladefile = 'SaleReturnSelectionStep'
model_type

alias of object

create_model(store)[source]
post_init()[source]
setup_slaves()[source]
next_step()[source]
has_next_step()[source]
on_unknown_sale_check__toggled(check)[source]
class stoqlib.gui.wizards.salereturnwizard.SaleReturnItemsStep(wizard, previous, store, model)[source]

Bases: stoqlib.gui.wizards.abstractwizard.SellableItemStep

model_type

alias of ReturnedSale

item_table

alias of ReturnedSaleItem

cost_editable = False
summary_label_text = u'<b>Total to return:</b>'
batch_selection_dialog

alias of BatchIncreaseSelectionDialog

stock_labels_visible = False
post_init()[source]
next_step()[source]
get_columns(editable=True)[source]
get_saved_items()[source]
get_order_item(sellable, price, quantity, batch=None, parent=None)[source]
sellable_selected(sellable, batch=None)[source]
validate_step()[source]
validate(value)[source]
class stoqlib.gui.wizards.salereturnwizard.SaleReturnInvoiceStep(store, wizard, model=None, previous=None)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

gladefile = 'SaleReturnInvoiceStep'
model_type

alias of ReturnedSale

proxy_widgets = ['responsible', 'reason', 'sale_total', 'paid_total', 'returned_total', 'total_amount_abs']
post_init()[source]
next_step()[source]
has_next_step()[source]
setup_proxies()[source]
on_credit_checkbutton__toggled(widget)[source]
class stoqlib.gui.wizards.salereturnwizard.SaleReturnPaymentStep(store, wizard, model=None, previous=None)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

gladefile = 'HolderTemplate'
model_type

alias of ReturnedSale

post_init()[source]
setup_slaves()[source]
validate_step()[source]
has_next_step()[source]
class stoqlib.gui.wizards.salereturnwizard.SaleReturnWizard(store, model=None)[source]

Bases: stoqlib.gui.wizards.salereturnwizard._BaseSaleReturnWizard

Wizard for returning a sale

title = 'Return Sale Order'
help_section = 'sale-return'
finish()[source]
class stoqlib.gui.wizards.salereturnwizard.SaleTradeWizard(store, model=None)[source]

Bases: stoqlib.gui.wizards.salereturnwizard._BaseSaleReturnWizard

Wizard for trading a sale

title = 'Trade Sale Order'
help_section = 'sale-trade'
finish()[source]

salewizard Module

Sale wizard definition

class stoqlib.gui.wizards.salewizard.PaymentMethodStep(wizard, previous, store, model, method, outstanding_value=None, finish_on_total=True)[source]

Bases: stoqlib.gui.base.wizards.BaseWizardStep

gladefile = 'HolderTemplate'
slave_holder = 'place_holder'
validate_step()[source]
has_next_step()[source]
next_step()[source]
post_init()[source]
class stoqlib.gui.wizards.salewizard.BaseMethodSelectionStep[source]

Bases: object

Base class for method selection when doing client sales

Classes using this base class should have a select_method_holder EventBox and a cash_change_holder EventBox in the glade file

get_remaining_value()[source]
get_selected_method()[source]
setup_cash_payment(total=None)[source]
post_init()[source]
setup_slaves()[source]
next_step()[source]
on_payment_method_changed(slave, method_name)[source]
class stoqlib.gui.wizards.salewizard.ConfirmSaleBatchStep(store, wizard, model=None, previous=None)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

Step for selecting batches for sale items

Before going to SalesPersonStep, if a product is controlling batch and that information is not available (probably because the sale is quoted) this step will set it for you.

Note that each item can produce n items, n being the number of batches used for it. All of those items will be already on the sale and adjusted properly, tough.

gladefile = 'ConfirmSaleBatchStep'
model_type

alias of Sale

post_init()[source]
setup_proxies()[source]
next_step()[source]
on_sale_items__selection_changed(sale_items, item)[source]
on_sale_items__row_activated(sale_items, item)[source]
on_edit_btn__clicked(button)[source]
class stoqlib.gui.wizards.salewizard.SalesPersonStep(wizard, store, model, payment_group, previous=None)[source]

Bases: stoqlib.gui.wizards.salewizard.BaseMethodSelectionStep, stoqlib.gui.base.wizards.WizardEditorStep

An abstract step which allows to define a salesperson, the sale’s discount and surcharge, when it is needed.

gladefile = 'SalesPersonStep'
model_type

alias of Sale

proxy_widgets = ['salesperson', 'client', 'transporter', 'cost_center']
cfop_widgets = ('cfop',)
update_discount_and_surcharge()[source]
setup_widgets()[source]
post_init()[source]
setup_slaves()[source]
setup_proxies()[source]
key_F5()[source]
key_F6()[source]
key_F7()[source]
key_F8()[source]
on_client__content_changed(entry)[source]
on_payment_method_changed(slave, method)[source]
on_client__validate(widget, client)[source]
on_create_transporter__clicked(button)[source]
on_discount_slave_changed(slave)[source]
on_observations_button__clicked(*args)[source]
on_create_cfop__clicked(widget)[source]
on_invoice_number__validate(widget, value)[source]
on_transporter__validate(widget, transporter)[source]
class stoqlib.gui.wizards.salewizard.ConfirmSaleWizard(store, model, subtotal, total_paid=0, current_document=None)[source]

Bases: stoqlib.gui.base.wizards.BaseWizard

A wizard used when confirming a sale order. It means generate payments, fiscal data and update stock

size = (700, 400)
title = 'Sale Checkout'
help_section = 'sale-confirm'
get_subtotal()[source]

Fetch the sale subtotal without querying the database. The subtotal is the value of all items that are being sold

Returns:the subtotal of the current sale
get_total_amount()[source]

Fetch the total sale amount without querying the database. The total sale amount is the subtotal with discount and markups taken into account.

Returns:the total amount of the current sale
get_total_paid()[source]

Fetch the value already paid for this sale. This is only used when we return a project we already paid for.

Returns:the total paid value for the current sale
get_total_to_pay()[source]

Fetch the value the client still needs to pay.

This is a short hand for self.get_total_amount() - self.get_total_paid()

need_create_payment()[source]
print_sale_details()[source]
finish()[source]
stoqlib.gui.wizards.salewizard.test()[source]

stockdecreasewizard Module

Stock Decrease wizard definition

class stoqlib.gui.wizards.stockdecreasewizard.StartStockDecreaseStep(store, wizard, model=None, previous=None)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

gladefile = 'StartStockDecreaseStep'
model_type

alias of StockDecrease

proxy_widgets = ['confirm_date', 'branch', 'reason', 'removed_by', 'cfop', 'cost_center', 'person']
post_init()[source]
next_step()[source]
has_previous_step()[source]
setup_proxies()[source]
on_branch__validate(widget, branch)[source]
on_person__validate(widget, person_id)[source]
class stoqlib.gui.wizards.stockdecreasewizard.DecreaseItemStep(wizard, previous, store, model)[source]

Bases: stoqlib.gui.wizards.abstractwizard.SellableItemStep

Wizard step for purchase order’s items selection

model_type

alias of StockDecrease

item_table

alias of StockDecreaseItem

sellable_view

alias of ProductWithStockBranchView

summary_label_text = u'<b>Total quantity:</b>'
summary_label_column = 'quantity'
sellable_editable = False
validate_stock = True
batch_selection_dialog

alias of BatchDecreaseSelectionDialog

item_editor

alias of StockDecreaseItemEditor

post_init()[source]
get_sellable_view_query()[source]
get_order_item(sellable, cost, quantity, batch=None, parent=None)[source]
get_saved_items()[source]
get_columns()[source]
has_next_step()[source]
next_step()[source]
validate(value)[source]
class stoqlib.gui.wizards.stockdecreasewizard.StockDecreaseWizard(store)[source]

Bases: stoqlib.gui.base.wizards.BaseWizard

size = (775, 400)
title = 'Manual Stock Decrease'
need_cancel_confirmation = True
finish()[source]

stocktransferwizard Module

Stock transfer wizard definition

class stoqlib.gui.wizards.stocktransferwizard.StockTransferInitialStep(wizard, store, model)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

gladefile = 'StockTransferInitialStep'
model_type

alias of TransferOrder

proxy_widgets = ['open_date', 'destination_branch', 'source_responsible', 'comments']
setup_proxies()[source]
post_init()[source]
has_next_step()[source]
next_step()[source]
validate_step()[source]
on_destination_branch__validate(widget, branch)[source]
class stoqlib.gui.wizards.stocktransferwizard.StockTransferItemStep(wizard, previous, store, model)[source]

Bases: stoqlib.gui.wizards.abstractwizard.SellableItemStep

model_type

alias of TransferOrder

item_table

alias of TransferOrderItem

sellable_view

alias of ProductWithStockBranchView

batch_selection_dialog

alias of BatchDecreaseSelectionDialog

validate_stock = True
item_editor

alias of TransferItemEditor

cost_editable = False
get_sellable_view_query()[source]
get_saved_items()[source]
get_order_item(sellable, cost, quantity, batch=None, parent=None)[source]
get_columns()[source]
sellable_selected(sellable, batch=None)[source]
setup_slaves()[source]
post_init()[source]
has_next_step()[source]
class stoqlib.gui.wizards.stocktransferwizard.StockTransferWizard(store)[source]

Bases: stoqlib.gui.base.wizards.BaseWizard

title = u'Stock Transfer'
size = (750, 350)
finish()[source]

workorderpackagewizard Module

class stoqlib.gui.wizards.workorderpackagewizard.WorkOrderPackageReceiveSelectionStep(store, wizard, previous=None)[source]

Bases: stoqlib.gui.base.wizards.BaseWizardStep

Step responsible for selecting a work order package to receive

gladefile = 'WorkOrderPackageReceiveSelectionStep'
post_init()[source]
validate_step()[source]
next_step()[source]
has_next_step()[source]
class stoqlib.gui.wizards.workorderpackagewizard.WorkOrderPackageReceiveOrdersStep(store, wizard, model=None, previous=None)[source]

Bases: stoqlib.gui.base.wizards.WizardEditorStep

Used to show what work orders are inside the work order package

Right now this step doesn’t do much. It’ll show all orders inside the package that are going to be received together with it.

model_type

alias of WorkOrderPackage

gladefile = 'WorkOrderPackageReceiveOrdersStep'
proxy_widgets = ['identifier']
setup_proxies()[source]
has_next_step()[source]
on_workorders__selection_changed(workorders, selected)[source]
on_details_btn__clicked(button)[source]
class stoqlib.gui.wizards.workorderpackagewizard.WorkOrderPackageReceiveWizard(store)[source]

Bases: stoqlib.gui.base.wizards.BaseWizard

Wizard responsible for receiving work order packages

This will mark the selected package as received on finish

title = u'Receive work orders'
size = (800, 350)
finish()[source]

workorderquotewizard Module

Wizard for work order pre-sales

class stoqlib.gui.wizards.workorderquotewizard.WorkOrderQuoteStartStep(store, wizard, model=None, previous=None)[source]

Bases: stoqlib.gui.wizards.salequotewizard.StartSaleQuoteStep

First step for work order pre-sales

Just like stoqlib.gui.wizards.salequotewizard.StartSaleQuoteStep, but the work order category can be selected on it and the next step is WorkOrderStep

gladefile = 'WorkOrderQuoteStartStep'
model_type

alias of Sale

post_init()[source]
next_step()[source]
setup_proxies()[source]
on_wo_categories__content_changed(combo)[source]
class stoqlib.gui.wizards.workorderquotewizard.WorkOrderQuoteWorkOrderStep(store, wizard, previous, model)[source]

Bases: stoqlib.gui.base.wizards.BaseWizardStep

Second step for work order pre-sales

In this step, the sales person can/will create the workorder(s) required for this sale (one for each spectacles)

gladefile = 'WorkOrderQuoteWorkOrderStep'
get_work_order_slave(work_order)[source]

Get a slave for the work order

This is the slave that will be added for each created work order. Subclasses can override this to change it.

post_init()[source]
next_step()[source]
class stoqlib.gui.wizards.workorderquotewizard.WorkOrderQuoteItemStep(wizard, previous, store, model)[source]

Bases: stoqlib.gui.wizards.salequotewizard.SaleQuoteItemStep

Third step for work order pre-sales

Just like stoqlib.gui.wizards.salequotewizard.SaleQuoteItemStep, but each item added here will be added to a workorder too (selected on a combo).

get_extra_columns()[source]

Get some extra columns for the items list

Subclasses can override this and add some extra columns. Those columns will be added just after the ‘description’ and before the ‘quantity’ columns.

setup_work_order(work_order)[source]

Do some extra setup for the work order

This is called at the initialization of this step. Subclasses can override this to do any extra setup they need on the work order.

Parameters:work_order – the work order we are describing
setup_proxies()[source]
get_order_item(sellable, price, quantity, batch=None, parent=None)[source]
get_saved_items()[source]
remove_items(items)[source]
get_columns()[source]
validate_step()[source]
on_work_orders_combo__content_changed(combo)[source]
class stoqlib.gui.wizards.workorderquotewizard.WorkOrderQuoteWizard(store, model=None)[source]

Bases: stoqlib.gui.wizards.salequotewizard.SaleQuoteWizard

Wizard for work order pre-sales

This is similar to the regular pre-sale, but has an additional step to create some workorders, and the item step is changed a little bit, to allow the sales person to select in what work order the item should be added to.

get_title(model=None)[source]
get_first_step(store, model)[source]
finish()[source]