From 34859ada026a863980c207ff5d936590ea008de6 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sun, 3 Apr 2022 12:33:22 +0200 Subject: [PATCH] Make new barcode added via productpicker InplaceAddBarcodeToExistingProduct flow immediately searchable (closes #839) --- public/viewjs/components/productpicker.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/viewjs/components/productpicker.js b/public/viewjs/components/productpicker.js index 2a9d49ec..6003c92d 100644 --- a/public/viewjs/components/productpicker.js +++ b/public/viewjs/components/productpicker.js @@ -51,6 +51,11 @@ Grocy.Components.ProductPicker.InAnyFlow = function() Grocy.Components.ProductPicker.FinishFlow = function() { + if (GetUriParam("flow") == "InplaceAddBarcodeToExistingProduct") + { + $("#product_id option[value=\"" + Grocy.Components.ProductPicker.GetValue() + "\"]").attr("data-additional-searchdata", (i, value) => `${value || ""}${GetUriParam("barcode")},`); + } + RemoveUriParam("flow"); RemoveUriParam("barcode"); RemoveUriParam("product-name");