Skip to content

Commit

Permalink
chore: remove background job
Browse files Browse the repository at this point in the history
  • Loading branch information
ruthra-kumar committed Nov 4, 2024
1 parent de8787f commit 53e18a5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
28 changes: 0 additions & 28 deletions erpnext/accounts/doctype/payment_request/payment_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -968,31 +968,3 @@ def get_irequests_of_payment_request(doc: str | None = None) -> list:
},
)
return res


def get_all_irequests_of_cancelled_payment_request() -> list:
res = []

pr = qb.DocType("Payment Request")
if payment_requests := qb.from_(pr).select(pr.name).where(pr.docstatus.eq(2)).run(as_list=True):
#
payment_requests = [x[0] for x in payment_requests]

res = frappe.db.get_all(
"Integration Request",
{
"reference_doctype": "Payment Request",
"reference_docname": ["in", payment_requests],
"status": "Queued",
},
)
return res


def cancel_integration_requests_of_cancelled_payment_requests():
"""
Primarily used by background job
"""
integration_requests = get_all_irequests_of_cancelled_payment_request()
for ireq in integration_requests:
frappe.db.set_value("Integration Request", ireq.name, "status", "Cancelled")
1 change: 0 additions & 1 deletion erpnext/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@
"0/15 * * * *": [
"erpnext.manufacturing.doctype.bom_update_log.bom_update_log.resume_bom_cost_update_jobs",
"erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation.trigger_reconciliation_for_queued_docs",
"erpnext.accounts.doctype.payment_request.payment_request.cancel_integration_requests_of_cancelled_payment_requests",
],
"0/30 * * * *": [
"erpnext.utilities.doctype.video.video.update_youtube_data",
Expand Down

0 comments on commit 53e18a5

Please sign in to comment.