Reload the page if a stock row cannot be found by id (references #506)

This commit is contained in:
Bernd Bestel
2020-01-23 19:13:35 +01:00
parent 99d4b05a3c
commit b4997abf75

View File

@@ -119,6 +119,12 @@ function RefreshStockDetailRow(stockRowId)
function(result) function(result)
{ {
var stockRow = $('#stock-' + stockRowId + '-row'); var stockRow = $('#stock-' + stockRowId + '-row');
// If the stock row not exists / is invisible (happens after consume/undo because the undone new stock row has different id), just reload the page for now
if (!stockRow.length || stockRow.hasClass("d-none"))
{
window.location.reload();
}
if (result == null || result.amount == 0) if (result == null || result.amount == 0)
{ {