shuup.simple_supplier package¶
Subpackages¶
Submodules¶
shuup.simple_supplier.forms module¶
-
class
shuup.simple_supplier.forms.
StockAdjustmentForm
(*args, **kwargs)[source]¶ Bases:
django.forms.forms.Form
-
base_fields
= OrderedDict([('purchase_price', <django.forms.fields.DecimalField object at 0x7fabc7abafd0>), ('delta', <django.forms.fields.DecimalField object at 0x7fabc7be2cc0>)])¶
-
declared_fields
= OrderedDict([('purchase_price', <django.forms.fields.DecimalField object at 0x7fabc7abafd0>), ('delta', <django.forms.fields.DecimalField object at 0x7fabc7be2cc0>)])¶
-
media
¶
-
-
class
shuup.simple_supplier.forms.
AlertLimitForm
(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False)[source]¶ Bases:
django.forms.forms.Form
-
base_fields
= OrderedDict([('alert_limit', <django.forms.fields.DecimalField object at 0x7fabc7be26a0>)])¶
-
declared_fields
= OrderedDict([('alert_limit', <django.forms.fields.DecimalField object at 0x7fabc7be26a0>)])¶
-
media
¶
-
shuup.simple_supplier.models module¶
-
class
shuup.simple_supplier.models.
StockAdjustment
(id, product, supplier, created_on, created_by, delta, purchase_price_value, type)[source]¶ Bases:
django.db.models.base.Model
Parameters: - id (AutoField) – Id
- product (ForeignKey to
shuup.core.models.Product
) – Product - supplier (ForeignKey to
shuup.core.models.Supplier
) – Supplier - created_on (DateTimeField) – Created on
- created_by (ForeignKey to
django.contrib.auth.models.User
) – Created by - delta (QuantityField) – Delta
- purchase_price_value (MoneyValueField) – Purchase price value
- type (EnumIntegerField) – Type
-
product
¶
-
supplier
¶
-
created_by
¶
-
purchase_price
¶ Property for Price object.
Similar to
MoneyProperty
but also hasincludes_tax
field.Operaters with
TaxfulPrice
andTaxlessPrice
objects.
-
type
¶ A placeholder class that provides a way to set the attribute on the model.
-
currency
¶
-
includes_tax
¶
-
exception
DoesNotExist
¶
-
exception
StockAdjustment.
MultipleObjectsReturned
¶
-
StockAdjustment.
get_next_by_created_on
(*moreargs, **morekwargs)¶
-
StockAdjustment.
get_previous_by_created_on
(*moreargs, **morekwargs)¶
-
StockAdjustment.
get_type_display
(*moreargs, **morekwargs)¶
-
StockAdjustment.
objects
= <django.db.models.manager.Manager object>¶
-
class
shuup.simple_supplier.models.
StockCount
(id, alert_limit, product, supplier, logical_count, physical_count, stock_value_value)[source]¶ Bases:
django.db.models.base.Model
Parameters: - id (AutoField) – Id
- alert_limit (QuantityField) – Alert limit
- product (ForeignKey to
shuup.core.models.Product
) – Product - supplier (ForeignKey to
shuup.core.models.Supplier
) – Supplier - logical_count (QuantityField) – Logical count
- physical_count (QuantityField) – Physical count
- stock_value_value (MoneyValueField) – Stock value value
-
product
¶
-
supplier
¶
-
stock_value
¶ Property for Price object.
Similar to
MoneyProperty
but also hasincludes_tax
field.Operaters with
TaxfulPrice
andTaxlessPrice
objects.
-
stock_unit_price
¶ Property for Price object.
Similar to
MoneyProperty
but also hasincludes_tax
field.Operaters with
TaxfulPrice
andTaxlessPrice
objects.
-
currency
¶
-
includes_tax
¶
-
stock_unit_price_value
¶
-
exception
DoesNotExist
¶
-
exception
StockCount.
MultipleObjectsReturned
¶
-
StockCount.
objects
= <django.db.models.manager.Manager object>¶
shuup.simple_supplier.module module¶
-
class
shuup.simple_supplier.module.
SimpleSupplierModule
(supplier, options)[source]¶ Bases:
shuup.core.suppliers.base.BaseSupplierModule
-
identifier
= 'simple_supplier'¶
-
name
= 'Simple Supplier'¶
-
shuup.simple_supplier.notify_events module¶
-
class
shuup.simple_supplier.notify_events.
AlertLimitReached
(**variable_values)[source]¶ Bases:
shuup.notify.base.Event
-
cache_key_fmt
= 'stock_alert_%s_%s'¶
-
identifier
= 'alert_limit_reached'¶
-
name
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
bindings
= {}¶
-
variables
= {'product': <shuup.notify.base.Variable object at 0x7fabc7c781d0>, 'supplier': <shuup.notify.base.Variable object at 0x7fabc7c78048>, 'dispatched_last_24hs': <shuup.notify.base.Variable object at 0x7fabc7c78f28>}¶
-
shuup.simple_supplier.notify_script_template module¶
-
class
shuup.simple_supplier.notify_script_template.
StockLimitEmailForm
(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False)[source]¶ Bases:
django.forms.forms.Form
-
base_fields
= OrderedDict([('recipient', <django.forms.fields.EmailField object at 0x7fabc7bcb5f8>), ('last24hrs', <django.forms.fields.BooleanField object at 0x7fabc75c4438>)])¶
-
declared_fields
= OrderedDict([('recipient', <django.forms.fields.EmailField object at 0x7fabc7bcb5f8>), ('last24hrs', <django.forms.fields.BooleanField object at 0x7fabc75c4438>)])¶
-
media
¶
-
-
class
shuup.simple_supplier.notify_script_template.
StockLimitEmailScriptTemplate
(script_instance=None)[source]¶ Bases:
shuup.notify.script_template.generic.GenericSendEmailScriptTemplate
Parameters: script_instance (shuup.notify.models.script.Script|None) – script instance to change or None -
identifier
= 'stocks_limit_email'¶
-
event
¶ alias of
AlertLimitReached
-
name
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
description
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
help_text
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
extra_js_template_name
= None¶
-
base_form_class
¶ alias of
StockLimitEmailForm
-
shuup.simple_supplier.utils module¶
-
shuup.simple_supplier.utils.
get_current_stock_value
(supplier_id, product_id)[source]¶ Count stock values for supplier and product combination
Logical count is events minus orders bought (not cancelled) describing how many products is currently orderable Physical count is events minus orders actually sent describing how many products is currently in stock
Parameters: - supplier_id – supplier_id to count stock values for
- product_id – product_id to count stock values for
Returns: logical and physical count for product
Return type:
-
shuup.simple_supplier.utils.
get_stock_information_html
(supplier, product)[source]¶ Get html string to show current stock information for product
Parameters: - supplier (shuup.core.models.Supplier) – shuup Supplier
- product (shuup.core.models.Product) – shuup Product
Returns: html div as a string
Return type:
-
shuup.simple_supplier.utils.
get_stock_adjustment_div
(request, supplier, product)[source]¶ Get html string to adjust stock values
Contains inputs for purchase_price_value and delta
Parameters: - request (django.http.HttpRequest) – HTTP request
- supplier (shuup.core.models.Supplier) – shuup Supplier
- product (shuup.core.models.Product) – shuup Product
Returns: html div as a string
Return type:
Module contents¶
-
class
shuup.simple_supplier.
ShuupSimpleSupplierAppConfig
(*args, **kwargs)[source]¶ Bases:
shuup.apps.AppConfig
-
name
= 'shuup.simple_supplier'¶
-
verbose_name
= 'Shuup Simple Supplier'¶
-
label
= 'simple_supplier'¶
-
provides
= {'admin_product_form_part': ['shuup.simple_supplier.admin_module.forms:SimpleSupplierFormPart'], 'notify_script_template': ['shuup.simple_supplier.notify_script_template:StockLimitEmailScriptTemplate'], 'supplier_module': ['shuup.simple_supplier.module:SimpleSupplierModule'], 'notify_event': ['shuup.simple_supplier.notify_events:AlertLimitReached'], 'admin_module': ['shuup.simple_supplier.admin_module:StocksAdminModule']}¶
-