From 4d8f08eddd165828f202b1331f5ddf1e1cf63fef Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Fri, 23 Feb 2024 17:08:34 +0100 Subject: [PATCH] Also copy move_on_open when copying a product (fixes #2478) --- changelog/75_UNRELEASED_xxxx-xx-xx.md | 1 + public/viewjs/productform.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/changelog/75_UNRELEASED_xxxx-xx-xx.md b/changelog/75_UNRELEASED_xxxx-xx-xx.md index e23b844f..27e36040 100644 --- a/changelog/75_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/75_UNRELEASED_xxxx-xx-xx.md @@ -15,6 +15,7 @@ - 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 for the product's last price stock transactions with an empty or `0` price weren't ignored +- Fixed that when copying a product, the field "Move on open" wasn't copied along ### Shopping list diff --git a/public/viewjs/productform.js b/public/viewjs/productform.js index fbe517f8..0956c699 100644 --- a/public/viewjs/productform.js +++ b/public/viewjs/productform.js @@ -450,6 +450,10 @@ if (Grocy.EditMode == "create" && GetUriParam("copy-of") != undefined) $("#auto_reprint_stock_label").prop("checked", true); } $("#default_stock_label_type").val(sourceProduct.default_stock_label_type); + if (BoolVal(sourceProduct.move_on_open)) + { + $("#move_on_open").prop("checked", true); + } Grocy.FrontendHelpers.ValidateForm('product-form'); },