Skip to content

Commit efd3481

Browse files
Merge pull request #46986 from frappe/mergify/bp/version-14/pr-46971
fix: serial no validation for stock reconciliation (backport #46971)
2 parents 124ad72 + c388b75 commit efd3481

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

erpnext/stock/doctype/serial_no/serial_no.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,14 @@ def validate_serial_no(sle, item_det):
279279
_("Serial No {0} quantity {1} cannot be a fraction").format(sle.item_code, sle.actual_qty)
280280
)
281281

282-
if len(serial_nos) and len(serial_nos) != abs(cint(sle.actual_qty)):
282+
if (
283+
(
284+
(sle.voucher_type == "Stock Reconciliation" and sle.actual_qty > 0)
285+
or sle.voucher_type != "Stock Reconciliation"
286+
)
287+
and len(serial_nos)
288+
and len(serial_nos) != abs(cint(sle.actual_qty))
289+
):
283290
frappe.throw(
284291
_("{0} Serial Numbers required for Item {1}. You have provided {2}.").format(
285292
abs(sle.actual_qty), sle.item_code, len(serial_nos)

0 commit comments

Comments
 (0)