       count_on_hand: countOnHand
       backorderable: backorderable
     options =
-      success: successHandler
+      success: => @onSuccess()
       error: errorHandler
     @model.save(force: true, options)
 

  backorderableCheckbox = $("#backorderable-#{stockItemId}")
  checked = backorderableCheckbox.parent('td').attr('was-checked') is "true"
  backorderableCheckbox.prop('checked', checked)

successHandler = (model, response, options) =>
  toggleBackorderable(model.get('id'), false)
  Spree.NumberFieldUpdater.successHandler(model.id, model.get('count_on_hand'))
  show_flash("success", Spree.translations.updated_successfully)

errorHandler = (model, response, options) ->
  show_flash("error", response.responseText)

    Spree.NumberFieldUpdater.hideForm(stockItemId)
    Spree.NumberFieldUpdater.showReadOnly(stockItemId)

  onSuccess: ->
    @$('[name=backorderable]').prop('disabled', true)
    Spree.NumberFieldUpdater.successHandler(@model.id, @model.get('count_on_hand'))
    show_flash("success", Spree.translations.updated_successfully)

  onSubmit: (ev) ->
    ev.preventDefault()
    stockItemId = @model.id
