Fixed recipeposform initial product quantity unit was not set

This commit is contained in:
Bernd Bestel
2020-02-04 20:04:48 +01:00
parent 35388b798c
commit 06fe308f31
2 changed files with 3 additions and 1 deletions

View File

@@ -73,7 +73,7 @@ $(".input-group-productamountpicker").on("change", function()
var amount = $("#display_amount").val();
var destinationAmount = amount / quFactor;
if (destinationQuName == selectedQuName || Grocy.Components.ProductAmountPicker.AllowAnyQuEnabled)
if (destinationQuName == selectedQuName || Grocy.Components.ProductAmountPicker.AllowAnyQuEnabled || amount.toString().isEmpty() || selectedQuName.toString().isEmpty())
{
$("#qu-conversion-info").addClass("d-none");
}

View File

@@ -79,6 +79,8 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
$("#not_check_stock_fulfillment").prop("checked", productDetails.product.not_check_stock_fulfillment_for_recipes == 1);
Grocy.Components.ProductAmountPicker.SetQuantityUnit(productDetails.quantity_unit_stock.id);
$('#display_amount').focus();
Grocy.FrontendHelpers.ValidateForm('recipe-pos-form');
},