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
,Supplier
etc.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.enum
Anyone 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.enum
Policy for returning sales.
This enum is used by the
parameter
RETURN_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.enum
Policy for clients with late payments
This enum is used by the
parameter
LATE_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.enum
Policy for changing the
salesperson
on POS salesThis enum is used by the
parameter
ACCEPT_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.enum
An 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.enum
An 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.Exception
Error for config files which don’t have a certain section
-
exception
stoqlib.exceptions.
FilePermissionError
[source]¶ Bases:
exceptions.Exception
General error for file permissions.
-
exception
stoqlib.exceptions.
NoConfigurationError
[source]¶ Bases:
exceptions.Exception
Raise this error when we don’t have a config option properly set.
-
exception
stoqlib.exceptions.
ModelDataError
[source]¶ Bases:
exceptions.Exception
General model data errors
-
exception
stoqlib.exceptions.
SellError
[source]¶ Bases:
exceptions.Exception
Exceptions for sale operations
-
exception
stoqlib.exceptions.
DatabaseInconsistency
[source]¶ Bases:
exceptions.Exception
Exceptions for missing data or inconsistency
-
exception
stoqlib.exceptions.
DatabaseError
(msg, long=None)[source]¶ Bases:
exceptions.Exception
General database errors
There are two ways of raising this exception:
raise DatabaseError(msg) raise DatabaseError(short, msg)
-
exception
stoqlib.exceptions.
StockError
[source]¶ Bases:
exceptions.Exception
Exception for stock operations
-
exception
stoqlib.exceptions.
EditorError
[source]¶ Bases:
exceptions.Exception
Exception for stoqlib editors
-
exception
stoqlib.exceptions.
SelectionError
[source]¶ Bases:
exceptions.Exception
Invalid number of items selected in a list
-
exception
stoqlib.exceptions.
TillError
[source]¶ Bases:
exceptions.Exception
General Till operation errors
-
exception
stoqlib.exceptions.
PaymentError
[source]¶ Bases:
exceptions.Exception
General payment errors
-
exception
stoqlib.exceptions.
PaymentMethodError
[source]¶ Bases:
exceptions.Exception
Error for payment methods
-
exception
stoqlib.exceptions.
AdapterError
[source]¶ Bases:
exceptions.Exception
Raise this exception when an object try adding a facet but it doesn’t actually implements that interface
-
exception
stoqlib.exceptions.
UserProfileError
[source]¶ Bases:
exceptions.Exception
Raise when a certain user lacks credentials for an application
-
exception
stoqlib.exceptions.
LoginError
[source]¶ Bases:
exceptions.Exception
Raise when an username or password is invalid
-
exception
stoqlib.exceptions.
SQLError
[source]¶ Bases:
exceptions.Exception
Bad syntax for sql scripts
-
exception
stoqlib.exceptions.
SellableError
[source]¶ Bases:
exceptions.Exception
Errors for sellables
-
exception
stoqlib.exceptions.
StoqlibError
[source]¶ Bases:
exceptions.Exception
General Error for stoqlib domain classes and dialogs
-
exception
stoqlib.exceptions.
InvalidStatus
[source]¶ Bases:
exceptions.Exception
Invalid status for the object which the operation was requested
-
exception
stoqlib.exceptions.
NeedReason
[source]¶ Bases:
exceptions.Exception
The operation needs a reason to be accomplished
-
exception
stoqlib.exceptions.
BarcodeDoesNotExists
[source]¶ Bases:
exceptions.Exception
There are no products with the specified barcode
-
exception
stoqlib.exceptions.
DeviceError
[source]¶ Bases:
exceptions.Exception
A problem with a Device such as a fiscal printer
-
exception
stoqlib.exceptions.
TaxError
[source]¶ Bases:
exceptions.Exception
A 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
domain
Packageaccount
address
attachment
base
certificate
commission
costcenter
devices
event
events
exampledata
fiscal
image
interfaces
inventory
invoice
loan
parameter
payment.card
payment.category
payment.comment
payment.dailymovement
payment.group
payment.method
payment.operation
payment.payment
payment.renegotiation
payment.views
person
plugin
product
production
profile
purchase
receiving
returnedsale
sale
sellable
service
station
stockdecrease
synchronization
system
taxes
till
transfer
uiform
views
workorder
- Subpackages
- drivers Package
- exporters Package
- gui Package
gui
Packageevents
Modulefields
Modulefiscalprinter
Moduleinterfaces
Modulestockicons
Module- Subpackages
- base Package
- dialogs Package
dialogs
Packageaddressdialog
Modulebatchselectiondialog
Modulebranchdialog
Modulecertificatedialog
Moduleclientcategorydialog
Moduleclientdetails
Modulecredentialsdialog
Modulecontactsdialog
Modulecostcenterdialog
Modulecrashreportdialog
Modulecreditdialog
Moduledaterangedialog
Moduledevices
Modulefinancialreportdialog
Modulefeedbackdialog
Moduleimporterdialog
Moduleinitialstockdialog
Moduleinvoicedialog
Moduleinventorydetails
Modulelabeldialog
Moduleloandetails
Modulemanufacturerdialog
Modulemasseditordialog
Modulemissingitemsdialog
Modulepaymentcategorydialog
Modulepaymentchangedialog
Modulepaymentcommentsdialog
Modulepaymentdetails
Modulepaymentflowhistorydialog
Modulepaymentmethod
Modulepersonmergedialog
Modulepindialog
Modulepluginsdialog
Moduleproductiondetails
Moduleproductionquotedialog
Moduleproductstockdetails
Moduleprogressdialog
Moduleprogressbardialog
Modulepurchasedetails
Modulequotedialog
Modulereceivingdialog
Modulerenegotiationdetails
Modulereturnedsaledialog
Modulesaledetails
Modulesellabledialog
Modulesellableimage
Modulesintegradialog
Modulespreadsheetexporterdialog
Modulestartproduction
Modulestockcostdialog
Modulestockdecreasedialog
Modulesupplierdetails
Moduletilldailymovement
Moduletillhistory
Moduletilldetails
Moduletransferorderdialog
Moduleworkordercategorydialog
Module
- editors Package
editors
Packageaccounteditor
Moduleaccounttransactioneditor
Moduleaddresseditor
Modulebackupsettings
Modulebaseeditor
Modulecallseditor
Modulecategoryeditor
Modulecertificateeditor
Moduleclientcategoryeditor
Modulecontacteditor
Modulecostcentereditor
Modulecreditcheckhistoryeditor
Modulecrediteditor
Moduledeliveryeditor
Moduledeviceseditor
Modulediscounteditor
Modulefiscaleditor
Moduleformfieldeditor
Modulegrideditor
Moduleinventoryadjustmenteditor
Moduleinventoryeditor
Moduleinvoiceeditor
Moduleinvoiceitemeditor
Moduleloanitemeditor
Modulenoteeditor
Moduleparameterseditor
Modulepaymentcategoryeditor
Modulepaymenteditor
Modulepaymentmethodeditor
Modulepaymentseditor
Modulepersoneditor
Modulepreferenceseditor
Moduleproducteditor
Moduleproductioneditor
Moduleprofileeditor
Modulepurchaseeditor
Modulesaleeditor
Modulesellableeditor
Modulesellableuniteditor
Moduleserviceeditor
Moduleshortcutseditor
Modulestationeditor
Modulestockdecreaseeditor
Moduletaxclasseditor
Moduletilleditor
Moduletransfereditor
Moduleworkordercategoryeditor
Moduleworkordereditor
Module
- search Package
search
Packagecallsearch
Modulecategorysearch
Modulecreditcheckhistorysearch
Moduleclientsalaryhistorysearch
Modulecommissionsearch
Moduleconsignmentsearch
Modulecostcentersearch
Moduledeliverysearch
Moduleeventsearch
Modulefiscalsearch
Modulegridsearch
Moduleloansearch
Moduleparametersearch
Modulepaymentsearch
Modulepaymentreceivingsearch
Modulepersonsearch
Moduleproductionsearch
Moduleproductsearch
Moduleprofilesearch
Modulepurchasesearch
Modulereceivingsearch
Modulereturnedsalesearch
Modulesalespersonsearch
Modulesalesearch
Modulesearchcolumns
Modulesearchdialog
Modulesearcheditor
Modulesearchextension
Modulesearchfilters
Modulesearchoptions
Modulesearchslave
Modulesearchresultview
Modulesellablesearch
Modulesellableunitsearch
Moduleservicesearch
Modulestationsearch
Modulestockdecreasesearch
Moduletaxclasssearch
Moduletillsearch
Moduletransfersearch
Moduleworkordersearch
Module
- slaves Package
slaves
Packageaddressslave
Modulebranchslave
Modulecashchangeslave
Moduleclientslave
Modulecommissionslave
Moduledomainslavemapper
Moduleemployeeslave
Moduleimageslave
Modulepaymentconfirmslave
Modulepaymentmethodslave
Modulepaymentslave
Moduleproductionslave
Moduleproductslave
Modulereceivingslave
Modulesaleslave
Modulesellableslave
Moduleserviceslave
Modulesupplierslave
Moduletaxslave
Moduletillslave
Moduletransporterslave
Moduleuserbranchaccessslave
Moduleuserslave
Moduleworkorderslave
Module
- templates Package
- test Package
- wizards Package
wizards
Packageabstractwizard
Moduleconsignmentwizard
Moduleinventorywizard
Moduleloanwizard
Modulepersonwizard
Moduleproductionwizard
Moduleproductwizard
Modulepurchasefinishwizard
Modulepurchasequotewizard
Modulepurchasewizard
Modulereceivingwizard
Modulerenegotiationwizard
Modulesalequotewizard
Modulesalereturnwizard
Modulesalewizard
Modulestockdecreasewizard
Modulestocktransferwizard
Moduleworkorderpackagewizard
Moduleworkorderquotewizard
Module
- importers Package
importers
Packageaccountimporter
Moduleaccounttransactionimporter
Modulebranchimporter
Moduleclientimporter
Modulecreditproviderimporter
Modulecsvimporter
Moduleemployeeimporter
Modulegnucashimporter
Moduleimporter
Moduleinvoiceimporter
Moduleofximporter
Moduleproductimporter
Modulepurchaseimporter
Modulesaleimporter
Moduleserviceimporter
Modulestoqlibexamples
Modulesupplierimporter
Moduletransferimporter
Moduletransporterimporter
Module
- l10n Package
- lib Package
lib
Packagealgorithms
Moduleasyncrequests
Moduleappinfo
Moduleautoreload
Modulebarcode
Moduleboleto
Modulecertutils
Modulecolorutils
Moduleconfigparser
Moduleconsole
Modulecookie
Modulecountries
Modulecrashreport
Moduledaemonutils
Moduledateutils
Moduledecorators
Moduledefaults
Moduledevicemanager
Modulediffutils
Moduledistutils
Moduleenvironment
Moduleevent
Modulefileutils
Modulefilizola
Moduleformatters
Moduleinterfaces
Moduleintrospection
Moduleinvoice
Moduleimageutils
Modulekiwilibrary
Modulelatscii
Modulemessage
Moduleosutils
Moduleparameters
Modulepayment
Modulepermissions
Modulepgpass
Modulepdf
Modulepluginmanager
Moduleprocess
Moduleservices
Modulesession
Modulesettings
Modulesintegra
Modulesintegragenerator
Modulestringutils
Moduletemplate
Modulethreadutils
Moduletranslation
Moduleunittestutils
Moduleuptime
Modulevalidators
Modulewebservice
Moduleibpt
Modulexmlutils
Module- Subpackages
- net Package
- reporting Package
reporting
Packageboleto
Modulebooklet
Modulecallsreport
Moduleclientcredit
Modulefinancial
Moduleinventory
Modulelabelreport
Moduleloanreceipt
Modulepayment
Modulepaymentsreceipt
Moduleproduct
Moduleproduction
Modulepurchase
Modulepurchasereceival
Modulereport
Modulesale
Modulesalereturn
Moduleservice
Modulestockdecrease
Moduletill
Moduletransfer
Moduleutils
Moduleworkorder
Moduleperson
Module
- test Package