From 9115645e193d7bbdafbb028d9d182fe0c48cf9d3 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sun, 18 Oct 2020 14:51:32 +0200 Subject: [PATCH] Fixed consuming tare weight handling enabled products on the stock entries page (fixes #988) --- changelog/60_UNRELEASED_2020-xx-xx.md | 1 + public/viewjs/stockentries.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog/60_UNRELEASED_2020-xx-xx.md b/changelog/60_UNRELEASED_2020-xx-xx.md index b966dbeb..4c58496d 100644 --- a/changelog/60_UNRELEASED_2020-xx-xx.md +++ b/changelog/60_UNRELEASED_2020-xx-xx.md @@ -45,6 +45,7 @@ - Fixed that the aggregated amount of parent products was wrong on the stock overview page when the child products had not the same stock quantity units - Fixed that edited stock entries were not considered for the price history chart on the product card - Fixed that `FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING` is set to `false`, the purchase page validation failed (thanks @fipwmaqzufheoxq92ebc) +- Fixed that consuming products with enabled tare weight handling did not work on the stock entries page (also fixed that opening those products is not possible there) ### Shopping list improvements - Decimal amounts are now allowed (for any product, rounded by two decimal places) diff --git a/public/viewjs/stockentries.js b/public/viewjs/stockentries.js index b902515d..40b83959 100644 --- a/public/viewjs/stockentries.js +++ b/public/viewjs/stockentries.js @@ -43,7 +43,7 @@ $(document).on('click', '.stock-consume-button', function(e) var wasSpoiled = $(e.currentTarget).hasClass("stock-consume-button-spoiled"); - Grocy.Api.Post('stock/products/' + productId + '/consume', { 'amount': consumeAmount, 'spoiled': wasSpoiled, 'location_id': locationId, 'stock_entry_id': specificStockEntryId }, + Grocy.Api.Post('stock/products/' + productId + '/consume', { 'amount': consumeAmount, 'spoiled': wasSpoiled, 'location_id': locationId, 'stock_entry_id': specificStockEntryId, 'exact_amount': true }, function(bookingResponse) { Grocy.Api.Get('stock/products/' + productId,