Class s.d.i.Inventory(Domain):

Part of stoqlib.domain.inventory View In Hierarchy

The Inventory handles the logic related to creating inventories for the available products (or a group of) in a certain branch. It has two different states:

Instance Variablesopen_datethe date inventory process was started
close_datethe date inventory process was closed
branchbranch where the inventory process was done
Class VariablesSTATUS_OPENThe inventory process is open
STATUS_CLOSEDThe inventory process is closed
Method is_open Returns True if the inventory process is open, False
Method close Closes the inventory process
Method all_items_counted Returns True if all inventory items are counted, False
Method get_items Returns all the inventory items related to this inventory
Class Method get_open_branches Retuns all the branches available to open the inventory
Class Method has_open Returns if there is an inventory opened at the moment or not.
Method get_items_for_adjustment Returns all the inventory items that needs adjustment, that is
Method has_adjusted_items Returns if we already have an item adjusted or not.
Method cancel Cancel this inventory. Notice that, to cancel an inventory no
Method get_status_str Undocumented

Inherited from Domain:

Method __init__ Undocumented
Method _create Undocumented
Method user Undocumented
Class Method iselect Like select, but search on the adapter implementing the interface iface
Class Method iselectBy Like selectBy, but search on the adapter implementing the interface iface
Class Method iselectOne Like selectOne, but search on the adapter implementing the interface iface
Class Method iselectOneBy Like selectOneBy, but search on the adapter implementing the interface iface
Class Method iget Like get, but gets on the adapter implementing the interface iface

Inherited from AbstractModel (via Domain, BaseDomain):

Method __ne__ Undocumented
Method __eq__ Undocumented
Method _SO_setValue Undocumented
Method clone Get a persistent copy of an existent object. Remember that we can
Method get_connection Undocumented

Inherited from AdaptableORMObject (via Domain):

Class Method registerFacet Registers a facet for class cls.

Inherited from Adaptable (via Domain, AdaptableORMObject):

Class Method getFacetType Fetches a facet type associated with an interface, or raise
Class Method getFacetTypes Returns facet classes for this object
Method addFacet Adds a facet implementing iface for the current object
Method removeFacet Removes a facet from the current object
Method getFacets Gets a list of facets assoicated with the current object.
def is_open(self):
Returns True if the inventory process is open, False otherwise.
def close(self, close_date=None):
Closes the inventory process
Parametersclose_datethe closing date or None for right now.
(type: datetime.datetime )
def all_items_counted(self):
Returns True if all inventory items are counted, False otherwise.
def get_items(self):
Returns all the inventory items related to this inventory
Returnsitems (type: a sequence of InventoryItem )
@classmethod
def get_open_branches(cls, conn):
Retuns all the branches available to open the inventory process.
Returnsbranches (type: a sequence of PersonAdaptToBranch )
@classmethod
def has_open(cls, conn, branch):
Returns if there is an inventory opened at the moment or not.
ReturnsThe open inventory, if there is one. None otherwise.
def get_items_for_adjustment(self):
Returns all the inventory items that needs adjustment, that is the recorded quantity is different from the actual quantity.
Returnsitems (type: a sequence of InventoryItem )
def has_adjusted_items(self):
Returns if we already have an item adjusted or not.
ReturnsTrue if there is one or more items adjusted, False otherwise.
def cancel(self):
Cancel this inventory. Notice that, to cancel an inventory no products should have been adjusted.
def get_status_str(self):
Undocumented
API Documentation for Stoqlib, generated by pydoctor at 2009-07-14 16:00:32.