stoqlib Package¶
stoqlib Package¶
api Module¶
Stoqlib API
Singleton object which makes it easier to common stoqlib APIs without having to import their symbols.
-
class
stoqlib.api.StoqAPI[source]¶ Bases:
object-
config¶
-
db_settings¶
-
user_settings¶
-
for_combo(resultset, attr=None, empty=None, sorted=True)[source]¶ Prepares the result of a table for inserting into a combo. Formats the item and sorts them according to the current locale
Parameters: - resultset – a resultset
- attr – attribute to use instead of
IDescribable - empty – if set, add an initial None item with this parameter as a label
Example:
categories = self.store.find(SellableCategory) self.category_combo.prefill(api.for_combo(categories, attr='full_description'))
-
for_person_combo(resultset)[source]¶ This is similar to
for_combo()but takes a class that references aPerson, such as aClient,Company,Supplieretc.Parameters: resultset – a resultset Example:
suppliers = Supplier.get_active_suppliers(self.store) self.supplier.prefill(api.for_person_combo(suppliers))
-
get_branches_for_filter(store, use_id=False)[source]¶ Returns a list of branches to be used in a combo.
Parameters: use_id – If True, we will return the options using the object id instead of the real object.
-
enums Module¶
Database enums
-
class
stoqlib.enums.SyncPolicy[source]¶ Bases:
kiwi.python.enum- I{FROM_SOURCE}: from the source to the target
- I{FROM_TARGET}: from the target to the source
- I{BOTH}: in both directions
- I{INITIAL}: only when doing the initial clone
-
BOTH= <SyncPolicy value BOTH>¶
-
FROM_SOURCE= <SyncPolicy value FROM_SOURCE>¶
-
FROM_TARGET= <SyncPolicy value FROM_TARGET>¶
-
INITIAL= <SyncPolicy value INITIAL>¶
-
names= {'BOTH': <SyncPolicy value BOTH>, 'FROM_TARGET': <SyncPolicy value FROM_TARGET>, 'INITIAL': <SyncPolicy value INITIAL>, 'FROM_SOURCE': <SyncPolicy value FROM_SOURCE>}¶
-
values= {0: <SyncPolicy value FROM_SOURCE>, 1: <SyncPolicy value FROM_TARGET>, 2: <SyncPolicy value BOTH>, 3: <SyncPolicy value INITIAL>}¶
-
class
stoqlib.enums.CreatePaymentStatus[source]¶ Bases:
kiwi.python.enumAnyone who catches CreatePaymentEvent should return one of this.
-
FAIL= <CreatePaymentStatus value FAIL>¶
-
SUCCESS= <CreatePaymentStatus value SUCCESS>¶
-
UNHANDLED= <CreatePaymentStatus value UNHANDLED>¶
-
names= {'FAIL': <CreatePaymentStatus value FAIL>, 'UNHANDLED': <CreatePaymentStatus value UNHANDLED>, 'SUCCESS': <CreatePaymentStatus value SUCCESS>}¶
-
values= {0: <CreatePaymentStatus value SUCCESS>, 1: <CreatePaymentStatus value FAIL>, 2: <CreatePaymentStatus value UNHANDLED>}¶
-
-
class
stoqlib.enums.NFeDanfeOrientation[source]¶ Bases:
kiwi.python.enum-
LANDSCAPE= <NFeDanfeOrientation value LANDSCAPE>¶
-
PORTRAIT= <NFeDanfeOrientation value PORTRAIT>¶
-
names= {'PORTRAIT': <NFeDanfeOrientation value PORTRAIT>, 'LANDSCAPE': <NFeDanfeOrientation value LANDSCAPE>}¶
-
values= {0: <NFeDanfeOrientation value PORTRAIT>, 1: <NFeDanfeOrientation value LANDSCAPE>}¶
-
-
class
stoqlib.enums.ReturnPolicy[source]¶ Bases:
kiwi.python.enumPolicy for returning sales.
This enum is used by the
parameterRETURN_POLICY_ON_SALES.-
CLIENT_CHOICE= <ReturnPolicy value CLIENT_CHOICE>¶
-
RETURN_CREDIT= <ReturnPolicy value RETURN_CREDIT>¶
-
RETURN_MONEY= <ReturnPolicy value RETURN_MONEY>¶
-
names= {'RETURN_CREDIT': <ReturnPolicy value RETURN_CREDIT>, 'CLIENT_CHOICE': <ReturnPolicy value CLIENT_CHOICE>, 'RETURN_MONEY': <ReturnPolicy value RETURN_MONEY>}¶
-
values= {0: <ReturnPolicy value CLIENT_CHOICE>, 1: <ReturnPolicy value RETURN_MONEY>, 2: <ReturnPolicy value RETURN_CREDIT>}¶
-
-
class
stoqlib.enums.LatePaymentPolicy[source]¶ Bases:
kiwi.python.enumPolicy for clients with late payments
This enum is used by the
parameterLATE_PAYMENTS_POLICY.-
ALLOW_SALES= <LatePaymentPolicy value ALLOW_SALES>¶
-
DISALLOW_SALES= <LatePaymentPolicy value DISALLOW_SALES>¶
-
DISALLOW_STORE_CREDIT= <LatePaymentPolicy value DISALLOW_STORE_CREDIT>¶
-
names= {'DISALLOW_SALES': <LatePaymentPolicy value DISALLOW_SALES>, 'ALLOW_SALES': <LatePaymentPolicy value ALLOW_SALES>, 'DISALLOW_STORE_CREDIT': <LatePaymentPolicy value DISALLOW_STORE_CREDIT>}¶
-
values= {0: <LatePaymentPolicy value ALLOW_SALES>, 1: <LatePaymentPolicy value DISALLOW_STORE_CREDIT>, 2: <LatePaymentPolicy value DISALLOW_SALES>}¶
-
-
class
stoqlib.enums.ChangeSalespersonPolicy[source]¶ Bases:
kiwi.python.enumPolicy for changing the
salespersonon POS salesThis enum is used by the
parameterACCEPT_CHANGE_SALESPERSON-
ALLOW= <ChangeSalespersonPolicy value ALLOW>¶
-
DISALLOW= <ChangeSalespersonPolicy value DISALLOW>¶
-
FORCE_CHOOSE= <ChangeSalespersonPolicy value FORCE_CHOOSE>¶
-
names= {'FORCE_CHOOSE': <ChangeSalespersonPolicy value FORCE_CHOOSE>, 'ALLOW': <ChangeSalespersonPolicy value ALLOW>, 'DISALLOW': <ChangeSalespersonPolicy value DISALLOW>}¶
-
values= {0: <ChangeSalespersonPolicy value DISALLOW>, 1: <ChangeSalespersonPolicy value ALLOW>, 2: <ChangeSalespersonPolicy value FORCE_CHOOSE>}¶
-
-
class
stoqlib.enums.SearchFilterPosition[source]¶ Bases:
kiwi.python.enumAn enum used to indicate where a search filter should be added to a SearchContainer:
- TOP: top left corner - BOTTOM: bottom
-
BOTTOM= <SearchFilterPosition value BOTTOM>¶
-
TOP= <SearchFilterPosition value TOP>¶
-
names= {'TOP': <SearchFilterPosition value TOP>, 'BOTTOM': <SearchFilterPosition value BOTTOM>}¶
-
values= {0: <SearchFilterPosition value TOP>, 1: <SearchFilterPosition value BOTTOM>}¶
-
-
class
stoqlib.enums.RelativeLocation[source]¶ Bases:
kiwi.python.enumAn enum used to indicate the relative location between two persons
This enum is used by stoq-plugin-nfe We must maintain these values otherwise it will break the plugin
-
OTHER_COUNTRY= <RelativeLocation value OTHER_COUNTRY>¶
-
OTHER_STATE= <RelativeLocation value OTHER_STATE>¶
-
SAME_STATE= <RelativeLocation value SAME_STATE>¶
-
names= {'OTHER_COUNTRY': <RelativeLocation value OTHER_COUNTRY>, 'OTHER_STATE': <RelativeLocation value OTHER_STATE>, 'SAME_STATE': <RelativeLocation value SAME_STATE>}¶
-
values= {1: <RelativeLocation value SAME_STATE>, 2: <RelativeLocation value OTHER_STATE>, 3: <RelativeLocation value OTHER_COUNTRY>}¶
-
exceptions Module¶
Exception and warning definitions
-
exception
stoqlib.exceptions.ConfigError[source]¶ Bases:
exceptions.ExceptionError for config files which don’t have a certain section
-
exception
stoqlib.exceptions.FilePermissionError[source]¶ Bases:
exceptions.ExceptionGeneral error for file permissions.
-
exception
stoqlib.exceptions.NoConfigurationError[source]¶ Bases:
exceptions.ExceptionRaise this error when we don’t have a config option properly set.
-
exception
stoqlib.exceptions.ModelDataError[source]¶ Bases:
exceptions.ExceptionGeneral model data errors
-
exception
stoqlib.exceptions.SellError[source]¶ Bases:
exceptions.ExceptionExceptions for sale operations
-
exception
stoqlib.exceptions.DatabaseInconsistency[source]¶ Bases:
exceptions.ExceptionExceptions for missing data or inconsistency
-
exception
stoqlib.exceptions.DatabaseError(msg, long=None)[source]¶ Bases:
exceptions.ExceptionGeneral database errors
There are two ways of raising this exception:
raise DatabaseError(msg) raise DatabaseError(short, msg)
-
exception
stoqlib.exceptions.StockError[source]¶ Bases:
exceptions.ExceptionException for stock operations
-
exception
stoqlib.exceptions.EditorError[source]¶ Bases:
exceptions.ExceptionException for stoqlib editors
-
exception
stoqlib.exceptions.SelectionError[source]¶ Bases:
exceptions.ExceptionInvalid number of items selected in a list
-
exception
stoqlib.exceptions.TillError[source]¶ Bases:
exceptions.ExceptionGeneral Till operation errors
-
exception
stoqlib.exceptions.PaymentError[source]¶ Bases:
exceptions.ExceptionGeneral payment errors
-
exception
stoqlib.exceptions.PaymentMethodError[source]¶ Bases:
exceptions.ExceptionError for payment methods
-
exception
stoqlib.exceptions.AdapterError[source]¶ Bases:
exceptions.ExceptionRaise this exception when an object try adding a facet but it doesn’t actually implements that interface
-
exception
stoqlib.exceptions.UserProfileError[source]¶ Bases:
exceptions.ExceptionRaise when a certain user lacks credentials for an application
-
exception
stoqlib.exceptions.LoginError[source]¶ Bases:
exceptions.ExceptionRaise when an username or password is invalid
-
exception
stoqlib.exceptions.SQLError[source]¶ Bases:
exceptions.ExceptionBad syntax for sql scripts
-
exception
stoqlib.exceptions.SellableError[source]¶ Bases:
exceptions.ExceptionErrors for sellables
-
exception
stoqlib.exceptions.StoqlibError[source]¶ Bases:
exceptions.ExceptionGeneral Error for stoqlib domain classes and dialogs
-
exception
stoqlib.exceptions.InvalidStatus[source]¶ Bases:
exceptions.ExceptionInvalid status for the object which the operation was requested
-
exception
stoqlib.exceptions.NeedReason[source]¶ Bases:
exceptions.ExceptionThe operation needs a reason to be accomplished
-
exception
stoqlib.exceptions.BarcodeDoesNotExists[source]¶ Bases:
exceptions.ExceptionThere are no products with the specified barcode
-
exception
stoqlib.exceptions.DeviceError[source]¶ Bases:
exceptions.ExceptionA problem with a Device such as a fiscal printer
-
exception
stoqlib.exceptions.TaxError[source]¶ Bases:
exceptions.ExceptionA problem with taxes such as icms, ipi, etc.
For exemple: this might be raised if the tax rate has expired.
Subpackages¶
- database Package
- domain Package
domainPackageaccountaddressattachmentbasecertificatecommissioncostcenterdeviceseventeventsexampledatafiscalimageinterfacesinventoryinvoiceloanparameterpayment.cardpayment.categorypayment.commentpayment.dailymovementpayment.grouppayment.methodpayment.operationpayment.paymentpayment.renegotiationpayment.viewspersonpluginproductproductionprofilepurchasereceivingreturnedsalesalesellableservicestationstockdecreasesynchronizationsystemtaxestilltransferuiformviewsworkorder- Subpackages
- drivers Package
- exporters Package
- gui Package
guiPackageeventsModulefieldsModulefiscalprinterModuleinterfacesModulestockiconsModule- Subpackages
- base Package
- dialogs Package
dialogsPackageaddressdialogModulebatchselectiondialogModulebranchdialogModulecertificatedialogModuleclientcategorydialogModuleclientdetailsModulecredentialsdialogModulecontactsdialogModulecostcenterdialogModulecrashreportdialogModulecreditdialogModuledaterangedialogModuledevicesModulefinancialreportdialogModulefeedbackdialogModuleimporterdialogModuleinitialstockdialogModuleinvoicedialogModuleinventorydetailsModulelabeldialogModuleloandetailsModulemanufacturerdialogModulemasseditordialogModulemissingitemsdialogModulepaymentcategorydialogModulepaymentchangedialogModulepaymentcommentsdialogModulepaymentdetailsModulepaymentflowhistorydialogModulepaymentmethodModulepersonmergedialogModulepindialogModulepluginsdialogModuleproductiondetailsModuleproductionquotedialogModuleproductstockdetailsModuleprogressdialogModuleprogressbardialogModulepurchasedetailsModulequotedialogModulereceivingdialogModulerenegotiationdetailsModulereturnedsaledialogModulesaledetailsModulesellabledialogModulesellableimageModulesintegradialogModulespreadsheetexporterdialogModulestartproductionModulestockcostdialogModulestockdecreasedialogModulesupplierdetailsModuletilldailymovementModuletillhistoryModuletilldetailsModuletransferorderdialogModuleworkordercategorydialogModule
- editors Package
editorsPackageaccounteditorModuleaccounttransactioneditorModuleaddresseditorModulebackupsettingsModulebaseeditorModulecallseditorModulecategoryeditorModulecertificateeditorModuleclientcategoryeditorModulecontacteditorModulecostcentereditorModulecreditcheckhistoryeditorModulecrediteditorModuledeliveryeditorModuledeviceseditorModulediscounteditorModulefiscaleditorModuleformfieldeditorModulegrideditorModuleinventoryadjustmenteditorModuleinventoryeditorModuleinvoiceeditorModuleinvoiceitemeditorModuleloanitemeditorModulenoteeditorModuleparameterseditorModulepaymentcategoryeditorModulepaymenteditorModulepaymentmethodeditorModulepaymentseditorModulepersoneditorModulepreferenceseditorModuleproducteditorModuleproductioneditorModuleprofileeditorModulepurchaseeditorModulesaleeditorModulesellableeditorModulesellableuniteditorModuleserviceeditorModuleshortcutseditorModulestationeditorModulestockdecreaseeditorModuletaxclasseditorModuletilleditorModuletransfereditorModuleworkordercategoryeditorModuleworkordereditorModule
- search Package
searchPackagecallsearchModulecategorysearchModulecreditcheckhistorysearchModuleclientsalaryhistorysearchModulecommissionsearchModuleconsignmentsearchModulecostcentersearchModuledeliverysearchModuleeventsearchModulefiscalsearchModulegridsearchModuleloansearchModuleparametersearchModulepaymentsearchModulepaymentreceivingsearchModulepersonsearchModuleproductionsearchModuleproductsearchModuleprofilesearchModulepurchasesearchModulereceivingsearchModulereturnedsalesearchModulesalespersonsearchModulesalesearchModulesearchcolumnsModulesearchdialogModulesearcheditorModulesearchextensionModulesearchfiltersModulesearchoptionsModulesearchslaveModulesearchresultviewModulesellablesearchModulesellableunitsearchModuleservicesearchModulestationsearchModulestockdecreasesearchModuletaxclasssearchModuletillsearchModuletransfersearchModuleworkordersearchModule
- slaves Package
slavesPackageaddressslaveModulebranchslaveModulecashchangeslaveModuleclientslaveModulecommissionslaveModuledomainslavemapperModuleemployeeslaveModuleimageslaveModulepaymentconfirmslaveModulepaymentmethodslaveModulepaymentslaveModuleproductionslaveModuleproductslaveModulereceivingslaveModulesaleslaveModulesellableslaveModuleserviceslaveModulesupplierslaveModuletaxslaveModuletillslaveModuletransporterslaveModuleuserbranchaccessslaveModuleuserslaveModuleworkorderslaveModule
- templates Package
- test Package
- wizards Package
wizardsPackageabstractwizardModuleconsignmentwizardModuleinventorywizardModuleloanwizardModulepersonwizardModuleproductionwizardModuleproductwizardModulepurchasefinishwizardModulepurchasequotewizardModulepurchasewizardModulereceivingwizardModulerenegotiationwizardModulesalequotewizardModulesalereturnwizardModulesalewizardModulestockdecreasewizardModulestocktransferwizardModuleworkorderpackagewizardModuleworkorderquotewizardModule
- importers Package
importersPackageaccountimporterModuleaccounttransactionimporterModulebranchimporterModuleclientimporterModulecreditproviderimporterModulecsvimporterModuleemployeeimporterModulegnucashimporterModuleimporterModuleinvoiceimporterModuleofximporterModuleproductimporterModulepurchaseimporterModulesaleimporterModuleserviceimporterModulestoqlibexamplesModulesupplierimporterModuletransferimporterModuletransporterimporterModule
- l10n Package
- lib Package
libPackagealgorithmsModuleasyncrequestsModuleappinfoModuleautoreloadModulebarcodeModuleboletoModulecertutilsModulecolorutilsModuleconfigparserModuleconsoleModulecookieModulecountriesModulecrashreportModuledaemonutilsModuledateutilsModuledecoratorsModuledefaultsModuledevicemanagerModulediffutilsModuledistutilsModuleenvironmentModuleeventModulefileutilsModulefilizolaModuleformattersModuleinterfacesModuleintrospectionModuleinvoiceModuleimageutilsModulekiwilibraryModulelatsciiModulemessageModuleosutilsModuleparametersModulepaymentModulepermissionsModulepgpassModulepdfModulepluginmanagerModuleprocessModuleservicesModulesessionModulesettingsModulesintegraModulesintegrageneratorModulestringutilsModuletemplateModulethreadutilsModuletranslationModuleunittestutilsModuleuptimeModulevalidatorsModulewebserviceModuleibptModulexmlutilsModule- Subpackages
- net Package
- reporting Package
reportingPackageboletoModulebookletModulecallsreportModuleclientcreditModulefinancialModuleinventoryModulelabelreportModuleloanreceiptModulepaymentModulepaymentsreceiptModuleproductModuleproductionModulepurchaseModulepurchasereceivalModulereportModulesaleModulesalereturnModuleserviceModulestockdecreaseModuletillModuletransferModuleutilsModuleworkorderModulepersonModule
- test Package