shuup.simple_supplier package

Submodules

shuup.simple_supplier.forms module

class shuup.simple_supplier.forms.StockAdjustmentForm(*args, **kwargs)[source]

Bases: django.forms.forms.Form

clean_delta()[source]
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:
product
supplier
created_by
purchase_price

Property for Price object.

Similar to MoneyProperty but also has includes_tax field.

Operaters with TaxfulPrice and TaxlessPrice objects.

type

A placeholder class that provides a way to set the attribute on the model.

currency
includes_tax
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception StockAdjustment.MultipleObjectsReturned

Bases: django.core.exceptions.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:
product
supplier
stock_value

Property for Price object.

Similar to MoneyProperty but also has includes_tax field.

Operaters with TaxfulPrice and TaxlessPrice objects.

stock_unit_price

Property for Price object.

Similar to MoneyProperty but also has includes_tax field.

Operaters with TaxfulPrice and TaxlessPrice objects.

currency
includes_tax
stock_unit_price_value
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception StockCount.MultipleObjectsReturned

Bases: django.core.exceptions.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'
get_stock_statuses(product_ids)[source]
adjust_stock(product_id, delta, purchase_price=0, created_by=None, type=<StockAdjustmentType.INVENTORY: 1>)[source]
update_stock(product_id)[source]

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>
run()[source]
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

get_script_steps(form)[source]
get_initial()[source]
can_edit_script()[source]
We can only edit the script when:
  • the event is AlertLimitReached
  • has a single SendMail action in steps (oterwise we don’t know which to edit)

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:

dict

shuup.simple_supplier.utils.get_stock_information_div_id(supplier, product)[source]
shuup.simple_supplier.utils.get_stock_information_html(supplier, product)[source]

Get html string to show current stock information for product

Parameters:
Returns:

html div as a string

Return type:

str

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:
Returns:

html div as a string

Return type:

str

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']}