fix: use docstatus instead of status (backport #38439) (#38443)

fix: use `docstatus` instead of `status`

(cherry picked from commit 1423b38d50faa8b2f44cab9626a837037e1d0570)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
This commit is contained in:
mergify[bot] 2023-11-30 12:12:02 +05:30 committed by GitHub
parent 7005d51af3
commit a50e872820
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -770,8 +770,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