From 8f9b295e684fce2e7bf6a91d22a55cdc1dea67c2 Mon Sep 17 00:00:00 2001 From: TheDodger Date: Sun, 17 Mar 2024 21:24:35 +0100 Subject: [PATCH] Also copy treat_opened_as_out_of_stock when copying a product (#2501) --- changelog/76_UNRELEASED_xxxx-xx-xx.md | 1 + public/viewjs/productform.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/changelog/76_UNRELEASED_xxxx-xx-xx.md b/changelog/76_UNRELEASED_xxxx-xx-xx.md index 5a3a16fc..141dad55 100644 --- a/changelog/76_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/76_UNRELEASED_xxxx-xx-xx.md @@ -14,6 +14,7 @@ - This executes the configured barcode lookup plugin with the given barcode - If the lookup was successful, the product edit page of the created product is displayed, where the product setup can be completed (if required) - After that, the transaction is continued with that product +- Fixed that when copying a product, the field "Treat opened as out of stock" wasn't copied along ### Shopping list diff --git a/public/viewjs/productform.js b/public/viewjs/productform.js index 0956c699..4b991f3f 100644 --- a/public/viewjs/productform.js +++ b/public/viewjs/productform.js @@ -454,6 +454,10 @@ if (Grocy.EditMode == "create" && GetUriParam("copy-of") != undefined) { $("#move_on_open").prop("checked", true); } + if (BoolVal(sourceProduct.treat_opened_as_out_of_stock)) + { + $("#treat_opened_as_out_of_stock").prop("checked", true); + } Grocy.FrontendHelpers.ValidateForm('product-form'); },