def get_stock_adjustment_div(request, supplier, product):
 latest_adjustment = StockAdjustment.objects.filter(product=product, supplier=supplier, type=StockAdjustmentType.INVENTORY).last()
 purchase_price = (latest_adjustment.purchase_price_value if latest_adjustment else Decimal('0.00'))
 context = {'product': product, 'supplier': supplier, 'delta_step': pow(0.1, product.sales_unit.decimals), 'adjustment_form': StockAdjustmentForm(initial={'purchase_price': purchase_price, 'delta': None})}
 if ('shuup.notify' in settings.INSTALLED_APPS):
  from shuup.notify.models import Notification
  context['alert_limit_form'] = AlertLimitForm(initial={'alert_limit': 0})
  if (not get_missing_permissions(request.user, get_default_model_permissions(Notification))):
   context['notify_url'] = reverse('shuup_admin:notify.script.list')
  else:
   context['notify_url'] = ''
 return render_to_string('shuup/simple_supplier/admin/add_stock_form.jinja', context=context, request=request)

def get_stock_adjustment_div ( request , supplier , product ) : latest_adjustment = StockAdjustment . objects . filter ( product = product , supplier = supplier , type = StockAdjustmentType . INVENTORY ) . last ( ) purchase_price = ( latest_adjustment . purchase_price_value if latest_adjustment else Decimal ( '0.00' ) ) context = { 'product' : product , 'supplier' : supplier , 'delta_step' : pow ( 0.1 , product . sales_unit . decimals ) , 'adjustment_form' : StockAdjustmentForm ( initial = { 'purchase_price' : purchase_price , 'delta' : None } ) } if ( 'shuup.notify' in settings . INSTALLED_APPS ) : from shuup . notify . models import Notification context [ 'alert_limit_form' ] = AlertLimitForm ( initial = { 'alert_limit' : 0 } ) if ( not get_missing_permissions ( request . user , get_default_model_permissions ( Notification ) ) ) : context [ 'notify_url' ] = reverse ( 'shuup_admin:notify.script.list' ) else : context [ 'notify_url' ] = '' return render_to_string ( 'shuup/simple_supplier/admin/add_stock_form.jinja' , context = context , request = request )
get html string to adjust stock values contains inputs for purchase_price_value and delta .