           $scope.products.push newProduct
 
 
-
     $scope.hasVariants = (product) ->
       Object.keys(product.variants).length > 0
+
 
     $scope.updateProducts = (productsToSubmit) ->
       $scope.displayUpdating()


    $scope.editWarn = (product, variant) ->
      window.location = "/admin/products/" + product.permalink_live + ((if variant then "/variants/" + variant.id else "")) + "/edit"  if ($scope.dirtyProductCount() > 0 and confirm("Unsaved changes will be lost. Continue anyway?")) or ($scope.dirtyProductCount() is 0)

    $scope.deleteProduct = (product) ->
      if confirm("Are you sure?")

          product.supplier = supplier
          break


    $scope.updateOnHand = (product) ->
      product.on_hand = $scope.onHand(product)


    $scope.onHand = (product) ->
      onHand = 0
