We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 124ad72 + c388b75 commit efd3481Copy full SHA for efd3481
1 file changed
erpnext/stock/doctype/serial_no/serial_no.py
@@ -279,7 +279,14 @@ def validate_serial_no(sle, item_det):
279
_("Serial No {0} quantity {1} cannot be a fraction").format(sle.item_code, sle.actual_qty)
280
)
281
282
- if len(serial_nos) and len(serial_nos) != abs(cint(sle.actual_qty)):
+ 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
+ ):
290
frappe.throw(
291
_("{0} Serial Numbers required for Item {1}. You have provided {2}.").format(
292
abs(sle.actual_qty), sle.item_code, len(serial_nos)
0 commit comments