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

This commit is contained in:
Mihir Kandoi
2026-03-27 16:02:35 +05:30
committed by GitHub
parent 47bb728f65
commit 6008fa710d

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;
}