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
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -119,6 +119,12 @@ function RefreshStockDetailRow(stockRowId)
function(result)
{
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)
{