mirror of
https://github.com/grocy/grocy.git
synced 2025-08-07 23:09:48 +00:00
Fixed product copy source / default value prefilling handling (fixes #1179)
This commit is contained in:
parent
1567b9d9d9
commit
d9a3c5169e
@ -266,24 +266,6 @@ $("#delete-current-product-picture-button").on("click", function(e)
|
|||||||
$("#product-picture-label-none").removeClass("d-none");
|
$("#product-picture-label-none").removeClass("d-none");
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Grocy.EditMode === 'create')
|
|
||||||
{
|
|
||||||
if (Grocy.UserSettings.product_presets_location_id.toString() !== '-1')
|
|
||||||
{
|
|
||||||
$("#location_id").val(Grocy.UserSettings.product_presets_location_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Grocy.UserSettings.product_presets_product_group_id.toString() !== '-1')
|
|
||||||
{
|
|
||||||
$("#product_group_id").val(Grocy.UserSettings.product_presets_product_group_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Grocy.UserSettings.product_presets_qu_id.toString() !== '-1')
|
|
||||||
{
|
|
||||||
$("select.input-group-qu").val(Grocy.UserSettings.product_presets_qu_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var quConversionsTable = $('#qu-conversions-table-products').DataTable({
|
var quConversionsTable = $('#qu-conversions-table-products').DataTable({
|
||||||
'order': [[1, 'asc']],
|
'order': [[1, 'asc']],
|
||||||
"orderFixed": [[4, 'asc']],
|
"orderFixed": [[4, 'asc']],
|
||||||
@ -470,3 +452,20 @@ if (Grocy.EditMode == "create" && GetUriParam("copy-of") != undefined)
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
else if (Grocy.EditMode === 'create')
|
||||||
|
{
|
||||||
|
if (Grocy.UserSettings.product_presets_location_id.toString() !== '-1')
|
||||||
|
{
|
||||||
|
$("#location_id").val(Grocy.UserSettings.product_presets_location_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Grocy.UserSettings.product_presets_product_group_id.toString() !== '-1')
|
||||||
|
{
|
||||||
|
$("#product_group_id").val(Grocy.UserSettings.product_presets_product_group_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Grocy.UserSettings.product_presets_qu_id.toString() !== '-1')
|
||||||
|
{
|
||||||
|
$("select.input-group-qu").val(Grocy.UserSettings.product_presets_qu_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user