From fa32258553844c166b86913c67fc5429b2408e56 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Mon, 24 Aug 2020 18:16:32 +0200 Subject: [PATCH] Only reload "Disable stock fulfillment checking for this ingredient" by the products default when creating a recipe ingredient (fixes #910) --- changelog/60_UNRELEASED_2020-xx-xx.md | 1 + public/viewjs/recipeposform.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog/60_UNRELEASED_2020-xx-xx.md b/changelog/60_UNRELEASED_2020-xx-xx.md index 938fcfeb..5d0dcc90 100644 --- a/changelog/60_UNRELEASED_2020-xx-xx.md +++ b/changelog/60_UNRELEASED_2020-xx-xx.md @@ -34,6 +34,7 @@ - Fixed that images on the recipe gallery view were not scaled correctly on largers screens (thanks @zsarnett) - Fixed that decimal ingredient amounts maybe resulted in wrong conversions truncated decimal places if your locale does not use a dot as the decimal separator (thanks @m-byte) - Fixed that a recipe cannot be included in itself (because this will cause an infinite loop) (thanks @fipwmaqzufheoxq92ebc) +- Fixed that when editing a recipe ingredient the checkbox "Disable stock fulfillment checking for this ingredient" was not initaliased with the saved value ### Chores improvements/fixes - Changed that not assigned chores on the chores overview page display now just a dash instead of an ellipsis in the "Assigned to" column to make this more clear (thanks @Germs2004) diff --git a/public/viewjs/recipeposform.js b/public/viewjs/recipeposform.js index 55e559ab..381ca012 100644 --- a/public/viewjs/recipeposform.js +++ b/public/viewjs/recipeposform.js @@ -77,7 +77,10 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e) $("#display_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %s', '1')); } - $("#not_check_stock_fulfillment").prop("checked", productDetails.product.not_check_stock_fulfillment_for_recipes == 1); + if (Grocy.Mode == "create") + { + $("#not_check_stock_fulfillment").prop("checked", productDetails.product.not_check_stock_fulfillment_for_recipes == 1); + } if (!$("#only_check_single_unit_in_stock").prop("checked")) {