Skip to content

Commit

Permalink
fix: use docstatus instead of status (backport #38439) (#38442)
Browse files Browse the repository at this point in the history
fix: use `docstatus` instead of `status`

(cherry picked from commit 1423b38)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
  • Loading branch information
mergify[bot] and s-aga-r authored Nov 30, 2023
1 parent f9f65a5 commit 2dc4b02
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions erpnext/buying/doctype/purchase_order/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,8 @@ def get_mapped_subcontracting_order(source_name, target_doc=None):

@frappe.whitelist()
def is_subcontracting_order_created(po_name) -> bool:
count = frappe.db.count(
"Subcontracting Order", {"purchase_order": po_name, "status": ["not in", ["Draft", "Cancelled"]]}
return (
True
if frappe.db.exists("Subcontracting Order", {"purchase_order": po_name, "docstatus": ["=", 1]})
else False
)

return True if count else False

0 comments on commit 2dc4b02

Please sign in to comment.