Fixed stock QU change restriction / include undone stock transactions (fixes #1473)

This commit is contained in:
Bernd Bestel 2021-06-27 19:11:45 +02:00
parent e646dd9332
commit b7a6b91039
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -141,10 +141,10 @@ $('.save-product-button').on('click', function(e)
if (Grocy.EditMode == "edit")
{
Grocy.Api.Get('stock/products/' + Grocy.EditObjectId,
function(productDetails)
Grocy.Api.Get('objects/stock_log?query[]=product_id=' + Grocy.EditObjectId,
function(productJournalEntries)
{
if (productDetails.last_purchased == null)
if (productJournalEntries.length == 0)
{
$('#qu_id_stock').removeAttr("disabled");
}