Part of stoqlib.domain.sellable View In Hierarchy
| Instance Variables | status | status the sellable is in (type: enum ) |
| price | price of sellable (type: float ) | |
| description | full description of sallable (type: string ) | |
| category | a reference to category table
(type: SellableCategory
) | |
| markup | ((cost/price)-1)*100 (type: float ) | |
| cost | final cost of sellable (type: float ) | |
| max_discount | maximum discount allowed (type: float ) | |
| commission | commission to pay after selling this sellable (type: float ) | |
| on_sale_price | A special price used when we have a "on sale" state (type: float ) | |
| on_sale_start_date | ||
| on_sale_end_date |
| Method | _create | Undocumented |
| Method | _set_code | Undocumented |
| Method | _set_barcode | Undocumented |
| Method | _get_price_by_markup | Undocumented |
| Method | _get_status_string | Undocumented |
| Method | _get_markup | Undocumented |
| Method | _set_markup | Undocumented |
| Method | _get_price | Undocumented |
| Method | _set_price | Undocumented |
| Method | _get_max_discount | Undocumented |
| Method | _set_max_discount | Undocumented |
| Method | _get_commission | Undocumented |
| Method | _set_commission | Undocumented |
| Method | can_be_sold | Whether the sellable is available and can be sold. |
| Method | is_sold | Whether the sellable is sold. |
| Method | sell | Sell the sellable |
| Method | cancel | Cancel the sellable |
| Method | can_sell | Make the object sellable |
| Method | can_remove | Whether we can delete this sellable from the database. |
| Method | get_short_description | Returns a short description of the current sale |
| Method | get_suggested_markup | Returns the suggested markup for the sellable |
| Method | get_unit_description | Returns the sellable category description |
| Method | get_category_description | Returns the description of this sellables category |
| Method | get_tax_constant | Returns the tax constant for this sellable. |
| Method | _check_unique_value_exists | Returns True if we already have a sellable with the given attribute |
| Method | check_code_exists | Returns True if we already have a sellable with the given code |
| Method | check_barcode_exists | Returns True if we already have a sellable with the given barcode |
| Method | get_description | Undocumented |
| Method | remove | Remove this sellable from the database (including the product or |
| Class Method | get_available_sellables_query | Undocumented |
| Class Method | get_available_sellables | Returns sellable objects which can be added in a sale. By |
| Class Method | get_unblocked_sellables | Returns unblocked sellable objects, which means the |
| Class Method | get_sold_sellables | Returns sellable objects which can be added in a sale. By |
| Class Method | _get_sellables_by_barcode | Undocumented |
| Class Method | get_availables_by_barcode | Returns a list of avaliable sellables that can be sold. |
| Class Method | get_availables_and_sold_by_barcode | Returns a list of avaliable sellables and also sellables that |
| Class Method | get_unblocked_by_categories | Returns the available sellables by a list of categories. |
Inherited from Domain:
| Method | __init__ | 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. |
| Returns | if the item can be sold (type: boolean ) | |
False if the product/service was never sold or received. True otherwise.
| Returns | description (type: string ) | |
| Returns | suggested markup (type: decimal ) | |
| Returns | the category description or an empty string if no category was set. | |
| Returns | sellable category description | |
| Returns | the tax constant or None if unset | |
| Parameters | conn | a database connection |
| storable | if True, only return Storables | |
| supplier | a supplier or None, if set limit the returned object to this supplier |
| Parameters | conn | a orm Transaction instance |
| barcode | a string representing a sellable barcode |
| Parameters | conn | a orm Transaction instance |
| barcode | a string representing a sellable barcode |
| Parameters | conn | a orm Transaction instance |
| categories | a list of SellableCategory instances | |
| include_uncategorized | whether or not include the sellables without a category |