mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-02 10:04:40 +00:00
fix: serial no validation for stock reconciliation
(cherry picked from commit a3d4d34454)
This commit is contained in:
committed by
Mergify
parent
24681bd64f
commit
c388b7579c
@@ -279,7 +279,14 @@ def validate_serial_no(sle, item_det):
|
|||||||
_("Serial No {0} quantity {1} cannot be a fraction").format(sle.item_code, sle.actual_qty)
|
_("Serial No {0} quantity {1} cannot be a fraction").format(sle.item_code, sle.actual_qty)
|
||||||
)
|
)
|
||||||
|
|
||||||
if len(serial_nos) and len(serial_nos) != abs(cint(sle.actual_qty)):
|
if (
|
||||||
|
(
|
||||||
|
(sle.voucher_type == "Stock Reconciliation" and sle.actual_qty > 0)
|
||||||
|
or sle.voucher_type != "Stock Reconciliation"
|
||||||
|
)
|
||||||
|
and len(serial_nos)
|
||||||
|
and len(serial_nos) != abs(cint(sle.actual_qty))
|
||||||
|
):
|
||||||
frappe.throw(
|
frappe.throw(
|
||||||
_("{0} Serial Numbers required for Item {1}. You have provided {2}.").format(
|
_("{0} Serial Numbers required for Item {1}. You have provided {2}.").format(
|
||||||
abs(sle.actual_qty), sle.item_code, len(serial_nos)
|
abs(sle.actual_qty), sle.item_code, len(serial_nos)
|
||||||
|
|||||||
Reference in New Issue
Block a user