fix: not able to make credit note for the sales invoice in which item code is not set (#18184)
This commit is contained in:
parent
35f15148fb
commit
334335a2ef
@ -75,7 +75,7 @@ def validate_returned_items(doc):
|
||||
|
||||
items_returned = False
|
||||
for d in doc.get("items"):
|
||||
if flt(d.qty) < 0 or d.get('received_qty') < 0:
|
||||
if d.item_code and (flt(d.qty) < 0 or d.get('received_qty') < 0):
|
||||
if d.item_code not in valid_items:
|
||||
frappe.throw(_("Row # {0}: Returned Item {1} does not exists in {2} {3}")
|
||||
.format(d.idx, d.item_code, doc.doctype, doc.return_against))
|
||||
@ -107,6 +107,9 @@ def validate_returned_items(doc):
|
||||
|
||||
items_returned = True
|
||||
|
||||
elif d.item_name:
|
||||
items_returned = True
|
||||
|
||||
if not items_returned:
|
||||
frappe.throw(_("Atleast one item should be entered with negative quantity in return document"))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user