Made "Disable stock fulfillment checking for this ingredient" a default option per product (closes #182)

This commit is contained in:
Bernd Bestel
2019-04-06 15:42:40 +02:00
parent 25c257bb2c
commit fa6f09679f
3 changed files with 16 additions and 2 deletions

View File

@@ -46,7 +46,7 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
Grocy.Components.ProductCard.Refresh(productId);
Grocy.Api.Get('stock/products/' + productId,
function (productDetails)
function(productDetails)
{
if (!$("#only_check_single_unit_in_stock").is(":checked"))
{
@@ -66,6 +66,8 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
$("#amount").parent().find(".invalid-feedback").text(L('The amount cannot be lower than #1', '1'));
}
$("#not_check_stock_fulfillment").prop("checked", productDetails.product.not_check_stock_fulfillment_for_recipes == 1);
$('#amount').focus();
Grocy.FrontendHelpers.ValidateForm('recipe-pos-form');
},