Skip to content

Commit

Permalink
fix: not able to create delivery note from sales order
Browse files Browse the repository at this point in the history
(cherry picked from commit bdf2f74)
  • Loading branch information
rohitwaghchaure authored and mergify[bot] committed Apr 28, 2023
1 parent 5f381cd commit 28dfc13
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions erpnext/stock/get_item_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -1508,11 +1508,15 @@ def get_so_reservation_for_item(args):
elif args.get("against_sales_invoice"):
sales_order = frappe.db.get_all(
"Sales Invoice Item",
filters={"parent": args.get("against_sales_invoice"), "item_code": args.get("item_code")},
filters={
"parent": args.get("against_sales_invoice"),
"item_code": args.get("item_code"),
"docstatus": 1,
},
fields="sales_order",
)
if sales_order and sales_order[0]:
if get_reserved_qty_for_so(sales_order[0][0], args.get("item_code")):
if get_reserved_qty_for_so(sales_order[0].sales_order, args.get("item_code")):
reserved_so = sales_order[0]
elif args.get("sales_order"):
if get_reserved_qty_for_so(args.get("sales_order"), args.get("item_code")):
Expand Down

0 comments on commit 28dfc13

Please sign in to comment.