Always allow move_on_open (closes #1983)

This commit is contained in:
Bernd Bestel
2022-08-27 11:27:49 +02:00
parent f1bc2cc40f
commit e8dc334758
5 changed files with 4 additions and 26 deletions

View File

@@ -133,7 +133,7 @@ $(document).on('click', '.product-open-button', function(e)
Grocy.FrontendHelpers.EndUiBusy();
toastr.success(__t('Marked %1$s of %2$s as opened', 1 + " " + productQuName, productName) + '<br><a class="btn btn-secondary btn-sm mt-2" href="#" onclick="UndoStockBookingEntry(' + bookingResponse[0].id + ',' + stockRowId + ')"><i class="fa-solid fa-undo"></i> ' + __t("Undo") + '</a>');
if (result.product.move_on_open == 1)
if (result.product.move_on_open == 1 && result.default_consume_location != null)
{
toastr.info('<span>' + __t("Moved to %1$s", result.default_consume_location.name) + "</span> <i class='fa-solid fa-exchange-alt'></i>");
}