Also copy treat_opened_as_out_of_stock when copying a product (#2501)

This commit is contained in:
TheDodger 2024-03-17 21:24:35 +01:00 committed by GitHub
parent 5167ba1154
commit 8f9b295e68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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');
},