Also copy treat_opened_as_out_of_stock when copying a product

This commit is contained in:
Manuel Worschech 2024-03-17 20:29:03 +01:00
parent 5167ba1154
commit 62f09b7d01
2 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -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');
},