fix: validate if quantity greater than 0 in item dashboard (backport #53846) (#53848)

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
fix: validate if quantity greater than 0 in item dashboard (#53846)
This commit is contained in:
mergify[bot]
2026-03-27 10:34:18 +00:00
committed by GitHub
parent c9953580b2
commit 9a2851f221

View File

@@ -281,8 +281,13 @@ erpnext.stock.move_item = function (item, source, target, actual_qty, rate, stoc
}
dialog.set_primary_action(__("Create Stock Entry"), function () {
if (source && (dialog.get_value("qty") == 0 || dialog.get_value("qty") > actual_qty)) {
frappe.msgprint(__("Quantity must be greater than zero, and less or equal to {0}", [actual_qty]));
if (flt(dialog.get_value("qty")) <= 0) {
frappe.msgprint(__("Quantity must be greater than zero"));
return;
}
if (source && dialog.get_value("qty") > actual_qty) {
frappe.msgprint(__("Quantity must be less than or equal to {0}", [actual_qty]));
return;
}