From 62f09b7d01dcd9b9f5db4c094768b7c27ea362fd Mon Sep 17 00:00:00 2001 From: Manuel Worschech Date: Sun, 17 Mar 2024 20:29:03 +0100 Subject: [PATCH] Also copy treat_opened_as_out_of_stock when copying a product --- 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'); },