fix: Serial No is mandatory even if the qty is 0

(cherry picked from commit cb0b6de4b9)
(cherry picked from commit aa6b891ef0)
This commit is contained in:
s-aga-r
2023-03-02 11:27:46 +05:30
committed by Mergify
parent 9930adcd28
commit 7629caa647

View File

@@ -131,7 +131,7 @@ def validate_returned_items(doc):
)
elif ref.serial_no:
if not d.serial_no:
if d.qty and not d.serial_no:
frappe.throw(_("Row # {0}: Serial No is mandatory").format(d.idx))
else:
serial_nos = get_serial_nos(d.serial_no)